home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / terminal / top_152 / src152.exe / rar / TOPLIB1.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-16  |  80KB  |  3,029 lines

  1. {┌─────────────────────────────────────────────────────────────────────────┐}
  2. {│                                                                         │}
  3. {│                              T. O. P.                                   │}
  4. {│                                                                         │}
  5. {│                        (T)he  (O)ther  (P)acket                         │}
  6. {│                                                                         │}
  7. {│ T O P L I B 1 . P A S                                                   │}
  8. {│                                                                         │}
  9. {│                                                                         │}
  10. {│ Library - Unit mit oft benötigten Routinen                              │}
  11. {└─────────────────────────────────────────────────────────────────────────┘}
  12.  
  13.  
  14. Procedure Link_erhalter (* Kanal : Byte; var Zeile : str80 *);
  15. var   i    : Byte;
  16.       Hstr : String[3];
  17. Begin
  18.   with K[Kanal]^ do
  19.   begin
  20.     if Zeile > '' then
  21.     begin
  22.       HoldStr := RestStr(Zeile);
  23.       for i := 1 to length(HoldStr) do
  24.       case HoldStr[i] of
  25.         BS  : HoldStr[i] := M1;
  26.         '#' : HoldStr[i] := B1;
  27.       end;
  28.       i := Byte(str_int(CutStr(Zeile)));
  29.       if i in [1..99] then
  30.       begin
  31.         Hold := true;
  32.         HoldTime := i;
  33.         Zeile := InfoZeile(160) + B1 + HoldStr;
  34.       end else Zeile := InfoZeile(161) + B1 + CutStr(Zeile);
  35.     end else
  36.     begin
  37.       Hold := false;
  38.       Zeile := InfoZeile(151);
  39.     end;
  40.   end;
  41. End;
  42.  
  43. Procedure RC_Update (* (var Zeile : String[40]) *);
  44. Var       i,i1,
  45.           Nr    : Byte;
  46.           Nstr  : String[1];
  47.           Hstr  : String[20];
  48.           Flag,
  49.           Found : Boolean;
  50. Begin
  51.   Nstr := '';
  52.   Flag := false;
  53.   Found := false;
  54.  
  55.   if Zeile > '' then
  56.   begin
  57.     if pos(B1,Zeile) > 0 then
  58.     begin
  59.       Hstr := RestStr(Zeile);
  60.       if (length(Hstr) = 1) and (Hstr[1] in ['0'..'5']) then
  61.       begin
  62.         Nstr := Hstr;
  63.         Flag := true;
  64.       end;
  65.     end;
  66.  
  67.     Hstr := CutStr(Zeile);
  68.  
  69.     Nr := REM_Auswert(show,2,Hstr);
  70.     if Nr in [1..100] then
  71.     begin
  72.       i := 0;
  73.       Repeat
  74.         inc(i);
  75.         i1 := G^.Remotes[i].BefNr;
  76.         if (i1 = Nr) and (pos(Hstr,G^.Remotes[i].Befehl) = 1) then
  77.         begin
  78.           if Flag then G^.Remotes[i].Level := str_int(Nstr);
  79.           Zeile := G^.Remotes[i].Befehl + B2 +
  80.                    int_str(G^.Remotes[i].Level);
  81.           Found := true;
  82.         end;
  83.       Until Found or (i >= maxREM);
  84.  
  85.       if Flag and Found then
  86.       begin
  87.         Assign(G^.TFile,SysPfad + RemDatei);
  88.         if RewriteTxt(G^.TFile) = 0 then
  89.         begin
  90.           for i := 1 to maxREM do if G^.Remotes[i].BefNr > 0 then
  91.           begin
  92.             Hstr := SFillStr(2,B1,int_str(G^.Remotes[i].BefNr)) + B1 +
  93.                     EFillStr(9,B1,G^.Remotes[i].Befehl) +
  94.                     int_str(G^.Remotes[i].AnzCh) + B1 +
  95.                     int_str(G^.Remotes[i].AnzPa) + B1 +
  96.                     int_str(G^.Remotes[i].Level);
  97.  
  98.             Writeln(G^.TFile,Hstr);
  99.           end;
  100.           FiResult := CloseTxt(G^.TFile);
  101.         end;
  102.       end;
  103.     end else Zeile := InfoZeile(130);
  104.   end else Zeile := S_ch;
  105. End;
  106.  
  107.  
  108. Procedure File_Umbenennen (* alt,neu : String[80]; var Ueber,Art : Integer *);
  109. var       f,f1 : File;
  110. Begin
  111.   Assign(f,alt);
  112.   Assign(f1,neu);
  113.   if Exists(alt) then
  114.   begin
  115.     if (Ueber = 1) then KillFile(neu); 
  116.     if Exists(neu) then
  117.     begin
  118.       Ueber := 135;    { Neuer Name existiert bereits }
  119.       Art := 2;
  120.     end else
  121.     begin
  122.       Rename(f,neu);
  123.       Ueber := 136;    { File wurde umbenannt }
  124.       Art := 3;
  125.     end;
  126.   end else
  127.   begin
  128.     Ueber := 144;      { Alter Name existert überhaupt nicht }
  129.     Art := 1;
  130.   end;
  131. End;
  132.  
  133.  
  134. Procedure BakenMenu;
  135. Const  ArtMax = 5;
  136. Var    i,
  137.        TNr  : Byte;
  138.        KC   : Sondertaste;
  139.        VC   : Char;
  140.        Flag : Boolean;
  141.        X,Y,
  142.        Art  : Byte;
  143.        Hstr : String[4];
  144.  
  145. Begin
  146.   Moni_Off(0);;
  147.   if show = 0 then TNr := Unproto
  148.               else TNr := K[show]^.TncNummer;
  149.   Flag := false;
  150.   for i := 9 to 15 do G^.Fstx[i] := 2;
  151.   G^.Fstr[7] := InfoZeile(73);
  152.  
  153.   G^.Fstr[9] := InfoZeile(58);
  154.   G^.Fstr[10] := InfoZeile(61);
  155.   G^.Fstr[11] := InfoZeile(62);
  156.   G^.Fstr[12] := InfoZeile(63);
  157.   G^.Fstr[13] := InfoZeile(64);
  158.  
  159.   Art := 5;
  160.  
  161.   Repeat
  162.     for i := 9 to 13 do
  163.     begin
  164.       G^.Fstr[i][vM+1] := B1;
  165.       G^.Fstr[i][hM+1] := B1;
  166.       G^.Fstr[i][vM] := B1;
  167.       G^.Fstr[i][hM] := B1;
  168.     end;
  169.  
  170.     if Art in [1..5] then
  171.     begin
  172.       X := vM;
  173.       Y := Art + 8;
  174.     end else
  175.     begin
  176.       X := hM;
  177.       Y := Art + 4;
  178.     end;
  179.     G^.Fstr[Y][X] := A_ch;
  180.  
  181.     if HardCur then SetzeCursor(X+1,Y);
  182.  
  183.     delete(G^.Fstr[9],vM+1,1);
  184.     insert(int_str(TNr),G^.Fstr[9],vM+1);
  185.     if TNC[TNr]^.Bake then G^.Fstr[13][vM+1] := X_ch;
  186.  
  187.     G^.Fstr[14] := '';
  188.     G^.Fstr[15] := '';
  189.     Fenster;
  190.  
  191.     _ReadKey(KC,VC);
  192.     Case KC of
  193.       _Esc : Flag := true;
  194.  
  195.      _AltH : TOP_Help(G^.OHelp[3]);
  196.  
  197.       _Ret : ;
  198.  
  199.        _F1 : Art := 1;
  200.        _F2 : Art := 2;
  201.        _F3 : Art := 3;
  202.        _F4 : Art := 4;
  203.        _F5 : Art := 5;
  204.  
  205.        _Up : if Art > 1  then dec(Art)
  206.                          else Alarm;
  207.  
  208.        _Dn : if Art < ArtMax then inc(Art)
  209.                              else Alarm;
  210.    _Andere : case VC of
  211.                B1:;
  212.                else Alarm;
  213.              end;
  214.        else Alarm;
  215.     End;
  216.  
  217.     if (KC in [_F1.._F5,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  218.     case Art of
  219.       1 : begin
  220.             G^.Fstr[9][vM] := S_ch;
  221.             Fenster;
  222.             Hstr := '';
  223.             GetString(Hstr,Attrib[3],1,2,15,KC,0,Ins);
  224.             if KC <> _Esc then
  225.             begin
  226.               i := Byte(str_int(Hstr));
  227.               if i in [1..Tnc_Anzahl] then TNr := i
  228.                                       else Alarm;
  229.             end;
  230.           end;
  231.       2 : begin
  232.             G^.Fstr[10][vM] := S_ch;
  233.             Fenster;
  234.             Hstr := int_str(TNC[TNr]^.BTimer);
  235.             GetString(Hstr,Attrib[3],4,2,15,KC,0,Ins);
  236.             if KC <> _Esc then
  237.             begin
  238.               TNC[TNr]^.BTimer := Word(str_int(Hstr));
  239.               if TNC[TNr]^.BTimer < MinBake then TNC[TNr]^.BTimer := DefBake;
  240.             end;
  241.           end;
  242.       3 : begin
  243.             G^.Fstr[11][vM] := S_ch;
  244.             Fenster;
  245.             GetString(TNC[TNr]^.BPFad,Attrib[3],78,2,15,KC,0,Ins);
  246.           end;
  247.       4 : begin
  248.             G^.Fstr[12][vM] := S_ch;
  249.             Fenster;
  250.             GetString(TNC[TNr]^.BText,Attrib[3],78,2,15,KC,0,Ins);
  251.           end;
  252.       5 : begin
  253.             TNC[TNr]^.Bake := not TNC[TNr]^.Bake;
  254.             Flag := true;
  255.           end;
  256.     end;
  257.  
  258.     SetzeFlags(0);
  259.   Until Flag;
  260.  
  261.   ClrFenster;
  262.   Neu_Bild;
  263.   Moni_On;
  264. End;
  265.  
  266.  
  267. Procedure Tschuess (* Kanal : Integer *);  (* Programm-Ende mit ALT-X *)
  268. var    ch : char;
  269.        KC : Sondertaste;
  270.        i  : Integer;
  271. Begin
  272.   G^.Fstr[7] := InfoZeile(84);
  273.   G^.Fstx[11] := 20;
  274.   G^.Fstr[11] := InfoZeile(85);
  275.   Fenster;
  276.   SetzeCursor(length(G^.Fstr[11])+G^.Fstx[11]-2,11);
  277.   clrFenster;
  278.   if Klingel then Morse(Kanal,'■');
  279.  
  280.   Repeat
  281.     _ReadKey(KC,Ch);
  282.     case KC of
  283.       _AltH   : TOP_Help(G^.OHelp[23]);
  284.       _Ret    : QRT := true;
  285.       _Andere : begin
  286.                   Ch := UpCase(Ch);
  287.                   QRT := Ch in YesMenge;
  288.                 end;
  289.     end;
  290.   Until QRT or (not QRT and (KC <> _AltH));
  291.   if not QRT then Neu_Bild;
  292.   Cursor_Aus;
  293. END;
  294.  
  295.  
  296. Procedure TschuessFenster;
  297. Begin
  298.   Cursor_Aus;
  299.   G^.Fstr[7] := Version;
  300.   G^.Fstx[11] := 29;
  301.   G^.Fstr[11] := InfoZeile(38);
  302.   G^.Fstx[13] := 34;
  303.   G^.Fstr[13] := InfoZeile(39);
  304.   Fenster;
  305.   clrFenster;
  306. End;
  307.  
  308. Procedure TestCheck (* Kanal : Byte; Zeile : Str80 *);
  309. var   i : Byte;
  310. Begin
  311.   with K[Kanal]^ do
  312.   begin
  313.     if Test then
  314.     begin
  315.       _aus(Attrib[20],Kanal,M1 + InfoZeile(191) + M1);
  316.       _aus(Attrib[20],TestMerk,M1 + InfoZeile(191) + M1);
  317.       if Klingel then
  318.       begin
  319.         Beep(G^.C1_Ton,G^.C1_TonTime);
  320.         Verzoegern(100);
  321.         Beep(G^.C1_Ton,G^.C1_TonTime);
  322.       end;
  323.       S_PAC(TestMerk,CM,true,'I ' + K[TestMerk]^.OwnCall);
  324.       S_PAC(Kanal,CM,true,'I ' + OwnCall);
  325.       K[TestMerk]^.Umlaut := K[TestMerk]^.UmlautMerk;
  326.       Umlaut := UmlautMerk;
  327.       StatusOut(TestMerk,4,1,Attrib[9],EFillStr(9,B1,K[TestMerk]^.OwnCall));
  328.       StatusOut(Kanal,4,1,Attrib[9],EFillStr(9,B1,OwnCall));
  329.       K[TestMerk]^.TestMerk := 0;
  330.       K[TestMerk]^.Test := false;
  331.       K[TestMerk]^.Call := '';
  332.       K[TestMerk]^.SCon[0] := false;
  333.       SCon[0] := false;
  334.       Call := '';
  335.       Test := false;
  336.       TestMerk := 0;
  337.     end else if not connected and not Kanal_Benutz and (Kanal > 0) then
  338.     begin
  339.       i := Byte(str_int(RestStr(Zeile)));
  340.       if not (i in [1..maxLink]) or K[i]^.Kanal_benutz or K[i]^.connected or
  341.          K[i]^.Mo.MonActive or (i = ConvHilfsPort) then i := KanalFrei(Kanal);
  342.       if i > 0 then
  343.       begin
  344.         TestMerk := i;
  345.         Test := true;
  346.         SCon[0] := true;
  347.  
  348.         K[i]^.SCon[0] := true;
  349.         K[i]^.TestMerk := Kanal;
  350.         K[i]^.Test := true;
  351.  
  352.         QSO_Date := Datum;
  353.         K[TestMerk]^.QSO_Date := Datum;
  354.  
  355.         QSO_Begin := copy(Uhrzeit,1,5);
  356.         K[TestMerk]^.QSO_Begin := copy(Uhrzeit,1,5);
  357.  
  358.         S_PAC(TestMerk,CM,true,'I ' + PhantasieCall);
  359.         S_PAC(Kanal,CM,true,'I ' + + PhantasieCall);
  360.  
  361.         K[TestMerk]^.Call := OwnCall;
  362.         Call := K[TestMerk]^.OwnCall;
  363.  
  364.         K[TestMerk]^.UmlautMerk := K[TestMerk]^.Umlaut;
  365.         K[TestMerk]^.User_Name := GetName(TestMerk,K[TestMerk]^.Call,K[TestMerk]^.Umlaut);
  366.  
  367.         UmlautMerk := Umlaut;
  368.         User_Name := GetName(Kanal,Call,Umlaut);
  369.  
  370.         StatusOut(TestMerk,4,1,Attrib[11],EFillStr(9,B1,K[TestMerk]^.Call));
  371.         StatusOut(Kanal,4,1,Attrib[11],EFillStr(9,B1,Call));
  372.         _aus(Attrib[20],Kanal,M1 + InfoZeile(190) + B1 + LRK + int_str(TestMerk) + RRK + M1);
  373.         _aus(Attrib[20],TestMerk,M1 + InfoZeile(190) + B1 + LRK + int_str(Kanal) + RRK + M1);
  374.         if Klingel then
  375.         begin
  376.           Beep(G^.C2_Ton,G^.C2_TonTime);
  377.           Verzoegern(100);
  378.           Beep(G^.C2_Ton,G^.C2_TonTime);
  379.         end;
  380.         Txt_Senden(TestMerk,6,0);
  381.         if not GrtFlag then Txt_Senden(TestMerk,3,0);
  382.         S_PAC(TestMerk,NU,true,'');
  383.       end else InfoOut(show,1,1,InfoZeile(94));
  384.     end else InfoOut(Kanal,1,1,InfoZeile(193));
  385.     Status2;
  386.   end;
  387. End;
  388.  
  389.  
  390. Procedure Connect (* Kanal : Byte; Zeile : Str80 *);
  391. var    Hstr : String[9];
  392.        i,i1 : Byte;
  393. Begin
  394.   with K[Kanal]^ do
  395.   begin
  396.     Zeile := UpCaseStr(Zeile);
  397.     if Kanal = 0 then K[0]^.TncNummer := Unproto
  398.                  else Outside := false;
  399.     if length(Zeile) > 1 then Ausgabe := false;
  400.     S_PAC(Kanal,CM,true,'C' + B1 + RestStr(Zeile));
  401.     i := 0;
  402.     if not connected then While (pos('ALREADY',Response) > 0) and (i < 15) do
  403.     begin
  404.       inc(i);
  405.       Ausgabe := false;
  406.       S_PAC(Kanal,CM,true,'I');
  407.       Hstr := Response;
  408.       Strip(Hstr);
  409.       Hstr := Hstr + '-' + int_str(i);
  410.       S_PAC(Kanal,CM,true,'I' + B1 + Hstr);
  411.       Ausgabe := false;
  412.       S_PAC(Kanal,CM,true,'C' + B1 + RestStr(Zeile));
  413.     end;
  414.     Rekonnekt := connected;
  415.     ConnectMerk := Zeile;
  416.     if length(Zeile) > 1 then Kanal_benutz := true;
  417.     if Kanal = 0 then Unproto_darstellen;
  418.   end;
  419. End;
  420.  
  421.  
  422. Procedure S_Aus (* Kanal,Art : Byte; Zeile : String *);
  423. Begin
  424.   with K[Kanal]^ do
  425.   begin
  426.     if Art in [1,3] then S_PAC(Kanal,NU,false,Zeile);
  427.     if Art in [2,3] then _aus(Attrib[19],Kanal,Zeile);
  428.   end;
  429. End;
  430.  
  431.  
  432. Procedure RC_Alle (* Kanal,Art : Byte *); (* Ausgabe aller Remote-RC's *)
  433. var    i,i1 : Byte;
  434.        Hstr : String[20];
  435. Begin
  436.   S_Aus(Kanal,Art,M1 + ConstStr(B1,21) + InfoZeile(173) + M2);
  437.   i1 := 1;
  438.   for i := 1 to maxREM do if G^.Remotes[i].BefNr > 0 then
  439.   begin
  440.     Hstr := B1 + EFillStr(9,Pkt ,G^.Remotes[i].Befehl) +
  441.             int_str(G^.Remotes[i].Level) + B1;
  442.  
  443.     if i1 mod 6 = 0 then
  444.     begin
  445.       KillEndBlanks(Hstr);
  446.       Hstr := Hstr + M1;
  447.     end;
  448.     S_Aus(Kanal,Art,Hstr);
  449.     inc(i1);
  450.   end;
  451.   S_Aus(Kanal,Art,M2);
  452. End;
  453.  
  454.  
  455. Procedure TNC_Parm (* Kanal,Art : Byte *);
  456. var    i,i1 : Word;
  457.        Bstr : String[8];
  458.        Hstr : String[80];
  459. Begin
  460.   with K[Kanal]^ do
  461.   begin
  462.     S_Aus(Kanal,Art,M1 + ConstStr(B1,21) + InfoZeile(40) + M2);
  463.     i := 1;
  464.     Assign(G^.TFile,SysPfad + TncDatei);
  465.     FiResult := ResetTxt(G^.TFile);
  466.     Repeat
  467.       Readln(G^.TFile,Hstr);
  468.       KillStartBlanks(Hstr);
  469.       i1 := pos('=',Hstr);
  470.       if i1 > 0 then
  471.       begin
  472.         Bstr := copy(Hstr,1,i1-1);
  473.         KillEndBlanks(Bstr);
  474.         if (pos('A',Bstr) > 0) or (pos(int_str(TncNummer),Bstr) > 0) then
  475.         begin
  476.           delete(Hstr,1,i1);
  477.           KillStartBlanks(Hstr);
  478.  
  479.           Ausgabe := false;
  480.           S_PAC(Kanal,CM,true,CutStr(Hstr));
  481.           Hstr := LRK + EFillStr(5,B1,CutStr(Hstr) + RRK) +
  482.                         EFillStr(12,B1,RestStr(Hstr)) + ': '+
  483.                         EFillStr(16,B1,Response);
  484.  
  485.           if length(Hstr) > 36 then
  486.           begin
  487.             KillEndBlanks(Hstr);
  488.             Hstr := Hstr + M1;
  489.             if i mod 2 = 0 then
  490.             begin
  491.               Hstr := M1 + Hstr;
  492.               inc(i);
  493.             end;
  494.           end else
  495.           begin
  496.             if i mod 2 = 0 then
  497.             begin
  498.               KillEndBlanks(Hstr);
  499.               Hstr := Hstr + M1;
  500.             end;
  501.             inc(i);
  502.           end;
  503.           S_Aus(Kanal,Art,Hstr);
  504.         end;
  505.       end;
  506.     Until Eof(G^.TFile);
  507.     FiResult := CloseTxt(G^.TFile);
  508.     S_Aus(Kanal,Art,M2);
  509.   end;
  510. End;
  511.  
  512.  
  513. Procedure GetVideoMode;
  514. Begin
  515.   if VideoSeg = SegHGC then
  516.   begin
  517.     StartColor := 15;
  518.     Hercules := true;
  519.   end else
  520.   begin
  521.     Color := true;
  522.     StartColor := 31;
  523.     Hercules := false;
  524.   end;
  525. End;
  526.  
  527.  
  528. Procedure Umlautstatus_Aendern (* Kanal : Byte *);
  529. Const  ArtMax = 4;
  530. Var    i    : Byte;
  531.        KC   : Sondertaste;
  532.        VC   : Char;
  533.        Flag : Boolean;
  534.        X,Y,
  535.        Art  : Byte;
  536.  
  537. Begin
  538.   with K[Kanal]^ do
  539.   begin
  540.     Moni_Off(0);;
  541.     Flag := false;
  542.     for i := 9 to 15 do G^.Fstx[i] := 2;
  543.     G^.Fstr[7] := InfoZeile(260);
  544.     G^.Fstr[9] := InfoZeile(261);
  545.     G^.Fstr[10] := InfoZeile(262);
  546.     G^.Fstr[11] := InfoZeile(263);
  547.     G^.Fstr[12] := InfoZeile(264);
  548.  
  549.     Art := 1;
  550.  
  551.     Repeat
  552.       for i := 9 to 12 do
  553.       begin
  554.         G^.Fstr[i][vM+1] := B1;
  555.         G^.Fstr[i][vM] := B1;
  556.       end;
  557.  
  558.       X := vM;
  559.       Y := Art + 8;
  560.  
  561.       G^.Fstr[Y][X] := A_ch;
  562.  
  563.       if HardCur then SetzeCursor(X+1,Y);
  564.  
  565.       if Umlaut = 1 then G^.Fstr[9][vM+1] := X_ch;
  566.       if Umlaut = 2 then G^.Fstr[10][vM+1] := X_ch;
  567.       if Umlaut = 3 then G^.Fstr[11][vM+1] := X_ch;
  568.  
  569.       G^.Fstr[13] := '';
  570.       G^.Fstr[14] := '';
  571.       G^.Fstr[15] := '';
  572.       Fenster;
  573.  
  574.       _ReadKey(KC,VC);
  575.       Case KC of
  576.         _Esc : Flag := true;
  577.  
  578.        _AltH : TOP_Help(G^.OHelp[24]);
  579.  
  580.         _Ret :;
  581.  
  582.          _F1 : Art := 1;
  583.          _F2 : Art := 2;
  584.          _F3 : Art := 3;
  585.          _F4 : Art := 4;
  586.  
  587.          _Up : if Art > 1  then dec(Art)
  588.                            else Alarm;
  589.  
  590.          _Dn : if Art < ArtMax then inc(Art)
  591.                                else Alarm;
  592.      _Andere : case VC of
  593.                  B1:;
  594.                  else Alarm;
  595.                end;
  596.  
  597.          else Alarm;
  598.       End;
  599.  
  600.       if (KC in [_F1.._F4,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  601.       case Art of
  602.         1 : begin
  603.               G^.Fstr[9][vM] := S_ch;
  604.               if Umlaut <> 1 then Umlaut := 1
  605.                              else Umlaut := 0;
  606.             end;
  607.         2 : begin
  608.               G^.Fstr[10][vM] := S_ch;
  609.               if Umlaut <> 2 then Umlaut := 2
  610.                              else Umlaut := 0;
  611.             end;
  612.         3 : begin
  613.               G^.Fstr[12][vM] := S_ch;
  614.               if Umlaut <> 3 then Umlaut := 3
  615.                              else Umlaut := 0;
  616.             end;
  617.         4 : if connected and (User_Name > '') and not Test then
  618.             begin
  619.               Neu_Name(Kanal,0,Call,User_Name);
  620.             end else Alarm;
  621.       end;
  622.  
  623.       SetzeFlags(Kanal);
  624.     Until Flag;
  625.  
  626.     if not connected then UmlautMerk := Umlaut;
  627.     ClrFenster;
  628.     Neu_Bild;
  629.     Moni_On;
  630.   end;
  631. End;
  632.  
  633.  
  634. Procedure Echo_Menue (* Kanal : Byte *);
  635. Const  ArtMax = 3;
  636. Var    i    : Byte;
  637.        KC   : Sondertaste;
  638.        VC   : Char;
  639.        Flag : Boolean;
  640.        X,Y,
  641.        Art  : Byte;
  642.  
  643. Begin
  644.   with K[Kanal]^ do
  645.   begin
  646.     Moni_Off(0);;
  647.     Flag := false;
  648.     for i := 9 to 15 do G^.Fstx[i] := 2;
  649.     G^.Fstr[7] := InfoZeile(74);
  650.     G^.Fstr[9] := InfoZeile(79);
  651.     G^.Fstr[10] := InfoZeile(80);
  652.     G^.Fstr[11] := InfoZeile(81);
  653.  
  654.     Art := 1;
  655.  
  656.     Repeat
  657.       for i := 9 to 11 do
  658.       begin
  659.         G^.Fstr[i][vM+1] := B1;
  660.         G^.Fstr[i][vM] := B1;
  661.       end;
  662.  
  663.       X := vM;
  664.       Y := Art + 8;
  665.       G^.Fstr[Y][X] := A_ch;
  666.  
  667.       if HardCur then SetzeCursor(X+1,Y);
  668.  
  669.       if Echo in [1,3,5,7] then G^.Fstr[9][vM+1] := X_ch;
  670.       if Echo in [2,3,6,7] then G^.Fstr[10][vM+1] := X_ch;
  671.       if Echo in [4..7]    then G^.Fstr[11][vM+1] := X_ch;
  672.  
  673.       G^.Fstr[12] := '';
  674.       G^.Fstr[13] := '';
  675.       G^.Fstr[14] := '';
  676.       G^.Fstr[15] := '';
  677.       Fenster;
  678.  
  679.       _ReadKey(KC,VC);
  680.       Case KC of
  681.         _Esc : Flag := true;
  682.  
  683.        _AltH : TOP_Help(G^.OHelp[5]);
  684.  
  685.         _Ret :;
  686.  
  687.          _F1 : Art := 1;
  688.          _F2 : Art := 2;
  689.          _F3 : Art := 3;
  690.  
  691.          _Up : if Art > 1  then dec(Art)
  692.                            else Alarm;
  693.  
  694.          _Dn : if Art < ArtMax then inc(Art)
  695.                                else Alarm;
  696.      _Andere : case VC of
  697.                  B1:;
  698.                  else Alarm;
  699.                end;
  700.  
  701.          else Alarm;
  702.       End;
  703.  
  704.       if (KC in [_F1.._F3,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  705.       case Art of
  706.         1 : if Echo in [1,3,5,7] then Echo := Echo - 1
  707.                                  else Echo := Echo + 1;
  708.  
  709.         2 : if Echo in [2,3,6,7] then Echo := Echo - 2
  710.                                  else Echo := Echo + 2;
  711.  
  712.         3 : if Echo in [4..7]    then Echo := Echo - 4
  713.                                  else Echo := Echo + 4;
  714.       end;
  715.  
  716.       SetzeFlags(Kanal);
  717.     Until Flag;
  718.  
  719.     ClrFenster;
  720.     Neu_Bild;
  721.     Moni_On;
  722.   end;
  723. End;
  724.  
  725.  
  726. Function  Lpt_Rdy (* StReg : Byte) : Boolean *);
  727. Begin
  728.   Lpt_Rdy := StReg and $80 = $80;
  729. End;
  730.  
  731.  
  732. Function  Lpt_PapOk (* StReg : Byte) : Boolean *);
  733. Begin
  734.   Lpt_PapOk := StReg and $20 = $00;
  735. End;
  736.  
  737.  
  738. Function  Lpt_Onl (* StReg : Byte) : Boolean *);
  739. Begin
  740.   Lpt_Onl := StReg and $10 = $10;
  741.   Lpt_Onl := true;
  742. End;
  743.  
  744.  
  745. Function  Lpt_Ok (* StReg : Byte) : Boolean *);
  746. Begin
  747.   Lpt_Ok := StReg and $08 = $08;
  748. End;
  749.  
  750.  
  751. Function  Lpt_All_Ok (* (Nr : Byte) : Boolean *);
  752. Var   b : Byte;
  753. Begin
  754.   b := Port[LPT_Base[Nr] + $01];
  755.   Lpt_All_Ok := Lpt_PapOk(b) and Lpt_Onl(b) and Lpt_Ok(b);
  756. End;
  757.  
  758.  
  759. Procedure Write_Lpt (* Kanal : Byte; Zeile : Str20 *);
  760. var     i,b     : Byte;
  761.         l,
  762.         TimeOut : LongInt;
  763.         Fehler  : Boolean;
  764.         KC      : Sondertaste;
  765.         VC      : Char;
  766. Begin
  767.   i := 0;
  768.   While not PrtFailure and (i < length(Zeile)) do
  769.   begin
  770.     inc(i);
  771.     TimeOut := 0;
  772.     l := TimerTick;
  773.     Repeat
  774.       b := Port[LPT_Base[PrtPort]+$01];
  775.       Fehler := not (Lpt_Ok(b) and Lpt_PapOk(b) and Lpt_Onl(b));
  776.       if l <> TimerTick then
  777.       begin
  778.         inc(TimeOut);
  779.         l := TimerTick;
  780.       end;
  781.     Until Lpt_Rdy(b) or Fehler or (TimeOut > Lpt_TimeOut);
  782.     if (TimeOut > Lpt_TimeOut) or Fehler then
  783.     begin
  784.       if BackScroll(Kanal) then WriteRam(1,YScrolPos,Attrib[4],1,EFillStr(80,B1,InfoZeile(291)))
  785.                            else InfoOut(Kanal,0,1,InfoZeile(291));
  786.       if Klingel then Beep(G^.PopFreq,G^.PopFreqTime);
  787.       _ReadKey(KC,VC);
  788.       if UpCase(VC) in YesMenge then PrtFailure := true;
  789.     end;
  790.  
  791.     if not PrtFailure then
  792.     begin
  793.       Port[LPT_Base[PrtPort]] := Ord(Zeile[i]);
  794.       Port[LPT_Base[PrtPort] + $02] := Port[LPT_Base[PrtPort] + $02] or $01;
  795.       Port[LPT_Base[PrtPort] + $02] := Port[LPT_Base[PrtPort] + $02] and $FE;
  796.     end;
  797.   end;
  798. End;
  799.  
  800.  
  801. Procedure LptEscSeq(* Kanal : Byte; Zeile : Str80 *);
  802. Var   Hstr : String[20];
  803. Begin
  804.   if LPT_vorhanden then
  805.   begin
  806.     Hstr := '';
  807.     while Zeile > '' do
  808.     begin
  809.       Hstr := Hstr + chr(str_int(CutStr(Zeile)));
  810.       Zeile := RestStr(Zeile);
  811.     end;
  812.     Write_Lpt(Kanal,Hstr);
  813.   end else InfoOut(Kanal,1,1,InfoZeile(292));
  814. End;
  815.  
  816.  
  817. Procedure Lpt_On_Off (* Kanal : Byte *);
  818. Var  i    : Byte;
  819.      D_ON : Boolean;
  820. Begin
  821.   with K[Kanal]^ do
  822.   begin
  823.     if Drucker then
  824.     begin
  825.       Write_Lpt(Kanal,LptEsc[10]);
  826.       Drucker := false;
  827.       Print := false;
  828.       PrtFailure := false;
  829.     end else
  830.     begin
  831.       if LPT_vorhanden then
  832.       begin
  833.         D_ON := false;
  834.         for i := 0 to maxLink do if K[i]^.Drucker then D_On := true;
  835.         if not D_ON then
  836.         begin
  837.           if Lpt_All_Ok(PrtPort) then
  838.           begin
  839.             Drucker := true;
  840.             Print := true;
  841.             Write_Lpt(Kanal,LptEsc[9]);
  842.           end else InfoOut(Kanal,1,1,InfoZeile(290));
  843.         end else Alarm;
  844.       end else InfoOut(Kanal,1,1,InfoZeile(292));
  845.     end;
  846.     for i := 0 to maxLink do SetzeFlags(i);
  847.   end;
  848. End;
  849.  
  850. Procedure Write_Drucker (* Kanal : Byte; Zeile : String *);
  851. var  i      : Integer;
  852.      ch     : char;
  853. Begin
  854.   if not PrtFailure then with K[Kanal]^ do
  855.   Begin
  856.     Zeile := Line_Convert(Kanal,2,Zeile);
  857.     for i := 1 to length(Zeile) do
  858.     Begin
  859.       ch := Zeile[i];
  860.       if (D_Spalte > 80) and (ch <> #13) then
  861.       Begin
  862.         Write_Lpt(Kanal,^J +M1);
  863.         D_Spalte := 1;
  864.       End;
  865.       case ch of
  866.        ^J,
  867.        M1  : Begin
  868.                if (Kanal = 0) then
  869.                Begin
  870.                  if D_Spalte <> 1 then Write_Lpt(Kanal,^J +M1);
  871.                End else Write_Lpt(Kanal,^J +M1);
  872.                D_Spalte := 1;
  873.              End;
  874.        #127: ;
  875.        #0..#31
  876.            : ;
  877.        else  Begin
  878.                Write_Lpt(Kanal,ch);
  879.                inc(D_Spalte);
  880.              End;
  881.       end;
  882.     End;
  883.   End;
  884. End;
  885.  
  886. Procedure Vorschreib_Uebergabe;
  887. var   VC    : char;
  888.       Hstr  : String[80];
  889.       KC    : Sondertaste;
  890.       a,i   : Integer;
  891.       Flag  : Boolean;
  892. Begin
  893.   Hstr := '';
  894.   Flag := false;
  895.   i := K[show]^.QBeg + 1;
  896.   WriteRam(1,K[show]^.Y1V+K[show]^.VBeg-1,Attrib[5],0,VorWrite[show]^[K[show]^.stV]);
  897.   WriteRam(1,i,Attrib[5],0,EFillStr(80,B1,InfoZeile(51)));
  898.   GetString(UeberNr,Attrib[5],2,length(InfoZeile(51))+1,i,KC,0,Flag);
  899.   a := str_int(UeberNr);
  900.   if KC = _Ret then
  901.   begin
  902.     if (a in [0..maxLink]) and (a <> show) then
  903.     begin
  904.       with K[show]^ do
  905.       begin
  906.         Hstr := VorWrite[show]^[stV];
  907.         if Vor_im_EMS then EMS_Seite_Einblenden(a,Vor);
  908.         Vor_Feld_Scroll(a);
  909.         Vor_Dn_Scroll(a);
  910.         VorWrite[a]^[K[a]^.stV] := Hstr;
  911.         Chr_Darstell(a,_Alt8,#255);
  912.         Chr_Darstell(a,_End,#255);
  913.         if Vor_im_EMS then EMS_Seite_Einblenden(show,Vor);
  914.         VorWrite[show]^[stV] := '';
  915.         Chr_Darstell(show,_Dn,#255);
  916.       end;
  917.     end else Alarm;
  918.   end;
  919.   Neu_Bild;
  920. End;
  921.  
  922.  
  923. Procedure Vorschreib_Such (Kanal : Byte);
  924. var i,i1    : Integer;
  925.     KC      : Sondertaste;
  926.     Hstr    : String[80];
  927.     Suchstr : String[20];
  928.     gefunden: Boolean;
  929.  
  930. Begin
  931.   with K[Kanal]^ do
  932.   begin;
  933.     gefunden := false;
  934.     Suchstr := '';
  935.     Hstr := B1 + InfoZeile(42) + B1;
  936.     WriteRam(1,VBeg,Attrib[5],0,EFillStr(80,B1,Hstr));
  937.     GetString(Suchstr,Attrib[5],20,length(Hstr)+1,VBeg,KC,0,Ins);
  938.     if KC <> _Esc then
  939.     begin
  940.       i := stV;
  941.       Repeat
  942.         i1 := pos(Suchstr,UpCaseStr(VorWrite[Kanal]^[i]));
  943.         if i1 > 0 then gefunden := true;
  944.         inc(i);
  945.       Until (gefunden) or (i = (VorZeilen - VorCmdZeilen)+1);
  946.       if gefunden then
  947.       begin
  948.         dec(i); Neu_Bild; X1V := i1; Y1V := 2;
  949.         if i = 1 then Y1V := 1;
  950.         if i = (VorZeilen - VorCmdZeilen) then Y1V := 3;
  951.         stV := i;
  952.         InfoOut(Kanal,1,1,InfoZeile(8));
  953.       end else InfoOut(Kanal,1,1,InfoZeile(9));
  954.     end else Neu_Bild;
  955.     Chr_Darstell(Kanal,_Andere,#255);
  956.   end;
  957. End;
  958.  
  959.  
  960. Procedure Belog_Eintrag (* Kanal : Byte *);
  961. Var  Hstr : String[80];
  962.      Bstr : String[20];
  963.      KC   : Sondertaste;
  964. Begin
  965.   with K[Kanal]^ do
  966.   begin
  967.     Bstr := '';
  968.     Hstr := B1 + InfoZeile(26) + B1;
  969.     WriteRam(1,VBeg,Attrib[5],0,EFillStr(80,B1,Hstr));
  970.     GetString(Bstr,Attrib[5],20,length(Hstr)+1,VBeg,KC,0,Ins);
  971.     if KC <> _Esc then
  972.     begin
  973.       LogMerker := Bstr;
  974.       BeLogEintr := Bstr > '';
  975.     end;
  976.     Neu_Bild;
  977.   end;
  978. End;
  979.  
  980.  
  981. Procedure L_ON (* Kanal : Byte; Zeile : Str128; Connect_out,ReKon : Boolean *);
  982. var i          : Byte;
  983.     ZStr       : String;
  984.     Flag       : Boolean;
  985.  
  986. Begin
  987.   with K[Kanal]^ do
  988.   Begin
  989.     if ScreenSTBY then
  990.     begin
  991.       ScreenSTBY := false;
  992.       ScreenTimer := ScreenInit;
  993.       Neu_Bild;
  994.     End;
  995.  
  996.     TNC_K := false;
  997.     i := pos(' - ',Zeile);
  998.     if i > 0 then  (* TNC V2.1c hat Uhrzeit gesendet *)
  999.     begin
  1000.       TNC_K := true;
  1001.       TNC_Date := copy(Zeile,i+3,8);
  1002.       if TNC_Date[3] = '/'       (* amerikanisches Format *)
  1003.          then TNC_Date := copy(TNC_Date,4,2) + Pkt  + copy(TNC_Date,1,2) +
  1004.                                                Pkt  + copy(TNC_Date,7,2);
  1005.       TNC_Date := GetWeekDay(TNC_Date) + B1 + TNC_Date;
  1006.       TNC_Time := copy(Zeile,i+12,8);
  1007.       delete(Zeile,i,20); (* Datum/Uhrzeit abschneiden *)
  1008.     end;
  1009.  
  1010.     if show <> Kanal then NochNichtGelesen := true
  1011.                      else NochNichtGelesen := false;
  1012.     Zeile := RestStr(Zeile);
  1013.  
  1014.     Call := ParmStr(3,B1,Zeile);
  1015.     StatusOut(Kanal,4,1,Attrib[11],EFillStr(9,B1,Call));
  1016.     connected := true;
  1017.  
  1018.     RxLines := 0;
  1019.     DBoxScaned := false;
  1020.     DieBoxPW := '';
  1021.     Hold := false;
  1022.  
  1023.     if WishBoxLst and (SysArt in SysMenge) then
  1024.     begin
  1025.       SysArt := 0;
  1026.       if not BoxScroll then CloseDBox(Kanal);
  1027.     end;
  1028.  
  1029.     UmlautMerk := Umlaut;
  1030.     User_Name := GetName(Kanal,Call,Umlaut);
  1031.  
  1032.     Flag := false;
  1033.     for i := 0 to maxSCon do SCon[i] := false;
  1034.     SysArt := 1;
  1035.     Repeat
  1036.       if pos(SNam[SysArt],UpCaseStr(User_Name)) = 1 then
  1037.       begin
  1038.         Flag := true;
  1039.         SCon[SysArt] := true;
  1040.       end else inc(SysArt);
  1041.     Until Flag or (SysArt > maxSCon);
  1042.  
  1043.     if Flag then
  1044.     Case SysArt of
  1045.       1,2,3,4,5,
  1046.       14: begin
  1047.             if SysArt = 2 then
  1048.             begin
  1049.               Zstr := Call;
  1050.               Strip(Zstr);
  1051.               ExtMld := Zstr + '>';
  1052.             end;
  1053.  
  1054.             if WishBoxLst then
  1055.             begin
  1056.               OpenDBox(Kanal);
  1057.               BoxStr := EFillStr(79,GPkt,GPkt + B1 + 'Connect to' + B1 +
  1058.                         Call + DP + B1 + User_Name + B1 + GPkt + B1 +
  1059.                         'Login' + DP + B1 + WochenTag + B1 +
  1060.                         copy(Datum,4,8) + B1 + copy(Uhrzeit,1,5) + B1) +
  1061.                         B1 + Chr(Attrib[20]);
  1062.               Rubrik := ConstStr(B1,8);
  1063.               Write_BoxStr(Kanal,1);
  1064.             end;
  1065.           end;
  1066.  
  1067.       11: if HoldDXc then
  1068.           begin
  1069.             Zstr := HoldDXcStr;
  1070.             Link_erhalter(Kanal,Zstr);
  1071.             SetzeFlags(Kanal);
  1072.           end;
  1073.  
  1074.       12: S_PAC(Kanal,NU,true,M1);
  1075.  
  1076.     end else
  1077.     begin
  1078.       SysArt := 0;
  1079.       SCon[0] := true;
  1080.     end;
  1081.  
  1082.     if Rekon then
  1083.     begin
  1084.       ConnectMerk := '';
  1085.       i := pos('>' + Call + B1,ACMerk + B1);
  1086.       if i > 0 then
  1087.       begin
  1088.         While (i > 0) and (ACMerk[i] <> B1) do dec(i);
  1089.         Zstr := copy(ACMerk,1,i);
  1090.         KillEndBlanks(Zstr);
  1091.         delete(ACMerk,1,i);
  1092.         Zstr := Zstr + B1 + CutStr(ACMerk) + B1;
  1093.         ACMerk := RestStr(ACMerk);
  1094.         While (length(ACMerk) > 0) and (pos('>',CutStr(ACMerk)) = 0) do
  1095.         begin
  1096.           Zstr := Zstr + CutStr(ACMerk) + B1;
  1097.           ACMerk := RestStr(ACMerk);
  1098.         end;
  1099.         KillStartBlanks(Zstr);
  1100.         KillEndBlanks(Zstr);
  1101.         ACMerk := Zstr + B1;
  1102.       end;
  1103.     end else
  1104.     begin
  1105.       While pos(M1,ConnectMerk) > 0 do
  1106.         delete(ConnectMerk,pos(M1,ConnectMerk),1);
  1107.       i := pos(B1,ConnectMerk);
  1108.       if i > 0 then ConnectMerk[i] := '>';
  1109.       KillEndBlanks(ConnectMerk);
  1110.       ACMerk := ACMerk + ConnectMerk + B1;
  1111.       ConnectMerk := '';
  1112.     end;
  1113.  
  1114.     RemAll := false;
  1115.  
  1116.     SetzeFlags(Kanal);
  1117.     StatusOut(Kanal,2,2,Attrib[12],EFillStr(19,B1,User_Name));
  1118.  
  1119.     if Connect_Out then
  1120.     begin
  1121.       QSO_Date := Datum;
  1122.       QSO_Begin := copy(Uhrzeit,1,5);
  1123.     end;
  1124.     if not TNC_ReadOut and TNC_K then
  1125.     begin
  1126.       QSO_Date := TNC_Date;
  1127.       QSO_Begin := TNC_Time;
  1128.     end;
  1129.  
  1130.     if Connect_out then
  1131.     begin
  1132.       S_PAC(Kanal,CM,true,'O' + int_str(MaxFrame));
  1133.       ConText := RestStr(RestStr(Zeile));
  1134.       _aus(Attrib[20],Kanal,Star + Zeile);
  1135.       if TNC_ReadOut or TNC_K then _aus(Attrib[20],Kanal,
  1136.                             B1 + LRK + QSO_Date + B1 + QSO_Begin + RRK);
  1137.       _aus(Attrib[20],Kanal,M1);
  1138.       if Auto_CON and (show = Kanal) then _aus(Attrib[20],Kanal,M1);
  1139.     end;
  1140.     Status2;
  1141.  
  1142.     if TNC_ReadOut and (Klingel or Speek) then
  1143.     begin
  1144.       if not Auto_CON then
  1145.       begin
  1146.         if NodeCon then
  1147.         begin
  1148.           if ReKon and Klingel then
  1149.           begin
  1150.             Beep(G^.C1_TON,G^.C1_TonTime);
  1151.             Verzoegern(100);
  1152.             Beep(G^.C2_Ton,G^.C2_TonTime);
  1153.           end else
  1154.           if Klingel then
  1155.           begin
  1156.             Beep(G^.C2_Ton,G^.C2_TonTime);
  1157.             Verzoegern(100);
  1158.             Beep(G^.C1_Ton,G^.C1_TonTime);
  1159.           end;
  1160.           NodeCon := false;
  1161.         end else
  1162.         begin
  1163.           if Klingel then C_Bell;
  1164.           if (morsen or Speek) and Outside then
  1165.           begin
  1166.             ZStr := Call;
  1167.             Strip(ZStr);
  1168.             if morsen then
  1169.             begin
  1170.               Verzoegern(10 * MPause);
  1171.               Morse(Kanal,ZStr);
  1172.             end;
  1173.             if Speek then Sprechen(Call);
  1174.           end;
  1175.         end;
  1176.       end;
  1177.     end;
  1178.  
  1179.     if Auto_CON then
  1180.     begin
  1181.       Outside := false;
  1182.       if ACZeile = '' then
  1183.       begin
  1184.         FoundCall := false;
  1185.         Auto_CON := false;
  1186.         if AusstiegsKanal then
  1187.         begin
  1188.           Ignore := true;
  1189.           K[GegenKanal]^.Ignore := true;
  1190.         end;
  1191.         C_Bell;
  1192.         SetzeFlags(Kanal);
  1193.         if morsen then
  1194.         begin
  1195.           Verzoegern(10 * MPause);
  1196.           ZStr := Call;
  1197.           Strip(ZStr);
  1198.           Morse(Kanal,ZStr);
  1199.         end;
  1200.         if Speek then Sprechen(Call);
  1201.       end;
  1202.       if Auto_CON then
  1203.       begin
  1204.         Zstr := GetConStr(ACZeile);
  1205.         S_PAC(Kanal,NU,true,ZStr + M1);
  1206.         if not AusstiegsKanal then InfoOut(Kanal,0,1,Zstr);
  1207.       end;
  1208.     end;
  1209.   end;
  1210. End;
  1211.  
  1212. Procedure L_Off (* Kanal : Byte *);
  1213. Var   i : Byte;
  1214. Begin
  1215.   with K[Kanal]^ do
  1216.   Begin
  1217.     Response := RestStr(Response);
  1218.     TNC_K := false;
  1219.     i := pos(' - ',Response);
  1220.     if i > 0 then
  1221.     Begin
  1222.       (* TNC V2.1c hat Uhrzeit gesendet *)
  1223.       TNC_K := true;
  1224.       TNC_Date := copy(Response,i+3,8);
  1225.       if TNC_Date[3] = '/' then (* amerikanisches Format *)
  1226.         TNC_Date := copy(TNC_Date,4,2) + Pkt  + copy(TNC_Date,1,2) +
  1227.                     Pkt  + copy(TNC_Date,7,2);
  1228.       TNC_Date := GetWeekDay(TNC_Date) + B1 + TNC_Date;
  1229.       TNC_Time := copy(Response,i+12,8);
  1230.       delete(Response,i,20);
  1231.     End;
  1232.     QSO_End := copy(Uhrzeit,1,5);
  1233.     if not TNC_ReadOut and TNC_K then QSO_End := copy(TNC_Time,1,5);
  1234.     if X2 > 1 then _aus(Attrib[20],Kanal,M1);
  1235.     _aus(Attrib[20],Kanal,Star + Response);
  1236.     Kanal_benutz := false;
  1237.     if (TNC_ReadOut or TNC_K) and connected
  1238.       then _aus(Attrib[20],Kanal,B1 + LRK + QSO_Date + B1 + QSO_End + RRK);
  1239.     _aus(Attrib[20],Kanal,M2);
  1240.  
  1241.     if FileSend then
  1242.     begin
  1243.       FiResult := CloseBin(TxFile);
  1244.       FileSend := false;
  1245.     end;
  1246.  
  1247.     if RX_Save then
  1248.     begin
  1249.       CloseRxFile(Kanal,1);
  1250.       RX_Save := false;
  1251.       RX_Bin := 0;
  1252.     end;
  1253.  
  1254.     if connected then
  1255.     Begin
  1256.       if (SysArt in SysMenge) and not BoxScroll then CloseDBox(Kanal);
  1257.       for i := 0 to maxSCon do SCon[i] := false;
  1258.       SysArt := 0;
  1259.       connected := false;
  1260.       FoundCall := false;
  1261.       NodeCon := false;
  1262.       Status2;
  1263.       if TNC_ReadOut or TNC_K then
  1264.       begin
  1265.         if Klingel and TNC_ReadOut then D_Bell;
  1266.         if LogArt > 0 then LogBuchEintrag(Kanal,1);
  1267.       end;
  1268.     end; (* if connected ... *)
  1269.  
  1270.     Close_7Plus(Kanal);
  1271.     Umlaut := UmlautMerk;
  1272.     Outside := true;
  1273.     Auto_CON := false;
  1274.     ACZeile := '';
  1275.     ACMerk := '';
  1276.     FoundCall := false;
  1277.     Hold := false;
  1278.     RemAll := false;
  1279.     MsgToMe := false;
  1280.     TxComp := false;
  1281.     RxComp := false;
  1282.     DBoxScaned := false;
  1283.     DieBoxPW := '';
  1284.     SysopParm := false;
  1285.     RTF := false;
  1286.     Upload := false;
  1287.     use_RomLw := false;
  1288.     RemPath := G^.Drive;
  1289.     TNC_Puffer := false;
  1290.     EraseBufferFile(Kanal);
  1291.     if Conv.Active then ConversIni(Kanal,false);;
  1292.     Ignore := false;
  1293.     SendZeile := '';
  1294.     MeldeCompZ := '';
  1295.     MeldeZeile := '';
  1296.     ExtMld := '';
  1297.     ExtMldFlag := false;
  1298.     RxLines := 0;
  1299.     Kopieren := 0;
  1300.     SysArt := 0;
  1301.     UserArt := 1;
  1302.     FileSendWait := false;
  1303.     RX_Bin := 0;
  1304.     AutoBinOn := AutoBin;
  1305.     for i := 1 to maxLink do if K[i]^.Kopieren = Kanal then K[i]^.Kopieren := 0;
  1306.     Auto_Init(Kanal);
  1307.     SetzeFlags(Kanal);
  1308.   End; (* WITH K[Kanal] ... *)
  1309. End;
  1310.  
  1311. Procedure LogBuchEintrag (* Kanal,Art : Byte *);
  1312. var    i      : Byte;
  1313.        Ch     : Char;
  1314.        Result : Integer;
  1315. Begin
  1316.   with K[Kanal]^ do
  1317.   begin
  1318.     if QSO_Date > '' then
  1319.     begin
  1320.       if Art = 0 then QSO_End := copy(Uhrzeit,1,5);
  1321.       Assign(G^.TFile,Sys1Pfad + LogDatei + LngExt);
  1322.       Result := AppendTxt(G^.TFile);
  1323.       if Result = 0 then
  1324.       begin
  1325.         i := pos(' via ',ConText);
  1326.         if i > 0 then
  1327.         begin
  1328.           delete(ConText,i+2,2);
  1329.           if length(ConText) > 50 then ConText := copy(ConText,1,50);
  1330.         end;
  1331.         if outside then Ch := S_ch
  1332.                    else Ch := B1;
  1333.         if not BeLogEintr then LogMerker := User_Name;
  1334.         Writeln(G^.TFile,QSO_Date,B2,QSO_Begin,'-',QSO_End,B2,
  1335.                          SFillStr(9,B1,TNC[TncNummer]^.QRG_Akt),B1,
  1336.                          SFillStr(2,B1,int_str(Kanal)),
  1337.                          Ch,B2,Call,ConstStr(B1,9-length(Call)),B2,
  1338.                          LogMerker,ConstStr(B1,20-length(LogMerker)),B2,
  1339.                          OwnCall,ConstStr(B1,9-length(OwnCall)),' > ',ConText);
  1340.         FiResult := CloseTxt(G^.TFile);
  1341.  
  1342.         if Art = 1 then
  1343.         begin
  1344.           LogMerker := '';
  1345.           BeLogEintr := false;
  1346.         end;
  1347.       end else InfoOut(Kanal,0,1,InfoZeile(45) + B1 + Int_Str(Result) + B1);
  1348.     end;
  1349.   end;
  1350. End;
  1351.  
  1352. Procedure Line_ON (* Kanal : Byte *);
  1353. Var  Bstr : String[80];
  1354.      Hstr : String[9];
  1355. Begin
  1356.   with K[Kanal]^ do
  1357.   begin
  1358.     if AusstiegsKanal and not FoundCall then
  1359.     begin
  1360.       K[GegenKanal]^.RemConReady := true;
  1361.       Ignore := true;
  1362.       K[GegenKanal]^.Ignore := true;
  1363.       S_PAC(GegenKanal,NU,true,M1 + ConStr + Call + M1);
  1364.     end;
  1365.  
  1366.     inc(CNr);
  1367.     _aus(Attrib[20],Kanal,InfoZeile(223) + B1+ int_str(CNr) + M1);
  1368.  
  1369.     if Outside and TNC_ReadOut then
  1370.     begin (* Conn. "von aussen" *)
  1371.       if Call_Exist(Kanal,3,'') then
  1372.       begin
  1373.         S_PAC(Kanal,NU,true,InfoZeile(116) + M1);
  1374.         S_PAC(Kanal,CM,true,'D');
  1375.         exit;
  1376.       end;
  1377.  
  1378.       if not AusstiegsKanal then
  1379.       begin
  1380.         TXT_Senden(Kanal,6,0);
  1381.         if not GrtFlag then TXT_Senden(Kanal,3,0);
  1382.         Hstr := Call;
  1383.         Strip(Hstr);
  1384.         if TopBox and (Exists(G^.MailPfad + Hstr + MsgExt)) then
  1385.         begin
  1386.           S_PAC(Kanal,NU,false,^G+M1+InfoZeile(110)+M2+InfoZeile(111)+M2);
  1387.           Send_Prompt(Kanal,FF);
  1388.         end;
  1389.         S_PAC(Kanal,NU,true,'');
  1390.       end;
  1391.     end; (* Outside *)
  1392.   end;
  1393. End;
  1394.  
  1395.  
  1396. Procedure FreiKanalSuch (* Kanal : Byte; Zeile : Str80 *);
  1397. var   i     : Integer;
  1398.       found : Boolean;
  1399.       Hstr  : String[80];
  1400.       Cross : Byte;
  1401. Begin
  1402.   found := false;
  1403.   KillEndBlanks(Zeile);
  1404.   Hstr := Zeile;
  1405.   While pos(B1,Hstr) > 0 do Hstr := RestStr(Hstr);
  1406.   if str_int(Hstr) > 0 then Gate := str_int(Hstr) else
  1407.   begin
  1408.     Zeile := CutStr(Zeile);
  1409.     if LinkExists(Zeile,Cross) then
  1410.     begin
  1411.       Gate := Cross;
  1412.       found := true;
  1413.     end else Gate := K[Kanal]^.TncNummer;
  1414.   end;
  1415.  
  1416.   i := maxLink;
  1417.   Repeat
  1418.     if (not K[i]^.connected) and (K[i]^.TncNummer = Gate) and
  1419.        (not K[i]^.Kanal_benutz) then FreiKanal := i;
  1420.     dec(i);
  1421.   Until (FreiKanal > 0) or (i < 1);
  1422.   if Gate > Tnc_Anzahl then FreiKanal := FF else
  1423.    if (FreiKanal > 0) and Call_Exist(Kanal,4,CutStr(Zeile)) then FreiKanal := FE;
  1424.   if FreiKanal in [1..maxLink] then K[FreiKanal]^.FoundCall := found;
  1425.   Gate := 0;
  1426. end;
  1427.  
  1428.  
  1429. Procedure SeekFreeChannel (* Kanal, TNr : Byte *);
  1430. Var    Free : Boolean;
  1431.        i    : Byte;
  1432. Begin
  1433.   if TNr in [1..Tnc_Anzahl] then
  1434.   begin
  1435.     Free := false;
  1436.     i := TNC[TNr]^.Kbis;
  1437.     While not Free and (i >=TNC[TNr]^.Kvon) do with K[i]^ do
  1438.     begin
  1439.       if not Kanal_benutz and
  1440.          not connected and
  1441.          not Test and
  1442.          not Mo.MonActive and
  1443.          (Cself = 0) and
  1444.          (i <> ConvHilfsPort) then
  1445.       begin
  1446.         Free := true;
  1447.       end else dec(i);
  1448.     end;
  1449.     if Free then
  1450.     begin
  1451.       SwitchChannel(i)
  1452.     end else Alarm;
  1453.   end else Alarm;
  1454. End;
  1455.  
  1456.  
  1457. Procedure Remote_Connect_Aufbauen (* Kanal : Byte; Zeile : Str80 *);
  1458. var i       : Integer;
  1459.     Xstr    : String[9];
  1460.     ok      : Boolean;
  1461.     i1      : Byte;
  1462.     AutoCon : Boolean;
  1463.  
  1464. begin
  1465.   KillEndBlanks(Zeile);
  1466.   i := length(Zeile);
  1467.   AutoCon := (K[K[Kanal]^.GegenKanal]^.FoundCall and
  1468.              (K[Kanal]^.GegenKanal > 0));
  1469.  
  1470.   if (i > 1) and (Zeile[i-1] = B1) then
  1471.   begin
  1472.     if str_int(Zeile[i]) in [1..Tnc_Anzahl] then delete(Zeile,i-1,2);
  1473.     KillEndBlanks(Zeile);
  1474.   end;
  1475.  
  1476.   if AutoCon then NeuCall := CutStr(Zeile)
  1477.              else NeuCall := Zeile;
  1478.  
  1479.   Xstr := RemoteCall;
  1480.   i := Byte(str_int(ParmStr(2,'-',Xstr)));
  1481.   if i = 0 then i := 16;
  1482.   dec(i);
  1483.   Strip(RemoteCall);
  1484.   RemoteCall := RemoteCall + '-' + int_str(i);
  1485.  
  1486.   K[FreiKanal]^.Kanal_benutz := true;
  1487.   S_PAC(FreiKanal,CM,true,'I '+ RemoteCall);
  1488.   with K[FreiKanal]^ do if FoundCall then
  1489.   begin
  1490.     GetMem(Lnk,SizeOf(Lnk^));
  1491.     Lnk_Init(TncNummer,TNC[TncNummer]^.QRG_Akt);
  1492.     ACZeile := GetConPfad(NeuCall);
  1493.     FreeMem(Lnk,SizeOf(Lnk^));
  1494.     Auto_CON := true;
  1495.     Zeile := GetConStr(ACZeile);
  1496.     Connect(FreiKanal,Zeile);
  1497.   end else
  1498.   begin
  1499.     K[FreiKanal]^.Outside := false;
  1500.     Connect(FreiKanal,'C' + B1 + NeuCall);
  1501.   end;
  1502.   S_PAC(Kanal,NU,true,Star + InfoZeile(138) + int_str(FreiKanal) +
  1503.       B2 + InfoZeile(139) + int_str(K[FreiKanal]^.TncNummer) + M1);
  1504. end;
  1505.  
  1506. Procedure RemConInit; (* Kanal : Byte; *)
  1507. Begin
  1508.   with K[Kanal]^ do
  1509.   begin
  1510.     with K[GegenKanal]^ do
  1511.     begin
  1512.       EinstiegsKanal := false;
  1513.       AusstiegsKanal := false;
  1514.       RemConReady := false;
  1515.       Ignore := false;
  1516.       SetzeFlags(GegenKanal);
  1517.       GegenKanal := 0;
  1518.     end;
  1519.  
  1520.     EinstiegsKanal := false;
  1521.     AusstiegsKanal := false;
  1522.     RemConReady := false;
  1523.     Ignore := false;
  1524.     GegenKanal := 0;
  1525.     SetzeFlags(Kanal);
  1526.   end;
  1527. End;
  1528.  
  1529.  
  1530. (* Das Unproto-Rufzeichen in der Statuszeile darstellen *)
  1531. (* Wurde geändert, weil ein zu langes Unproto den Rest der Statuszeile
  1532.    überschrieben hat - elegantere Lösung de DJ0HC *)
  1533.  
  1534. Procedure Unproto_darstellen;
  1535. var  i    : Integer;
  1536.      Hstr : String[19];
  1537. Begin
  1538.   K[0]^.TncNummer := Unproto;
  1539.   Ausgabe := false;
  1540.   S_PAC(0,CM,true,'C');
  1541.   i := pos('via',K[0]^.Response);
  1542.   if i > 0 then Hstr := copy(K[0]^.Response,1,i-1) else
  1543.                 Hstr := K[0]^.Response;
  1544.   Hstr := Channel_ID(0) + Hstr;
  1545.   StatusOut(0,2,1,Attrib[9],EFillStr(19,B1,Hstr));
  1546. End;
  1547.  
  1548. Procedure Terminal_Kanal (* Kanal : Byte; Anz : ShortInt *);
  1549. Begin
  1550.   case Anz of
  1551.      1 : if Kanal < maxLink then SwitchChannel(Kanal+1) else Alarm;
  1552.     -1 : if Kanal > 0 then SwitchChannel(Kanal-1) else Alarm;
  1553.     10 : if Kanal > 0 then
  1554.          begin
  1555.            if (Kanal+10) <= maxLink then SwitchChannel(Kanal+10) else Alarm;
  1556.          end else
  1557.          begin
  1558.            if multiTNC then
  1559.            begin
  1560.              inc(Unproto);
  1561.              if Unproto > TNC_Anzahl then unproto := 1;
  1562.              Unproto_darstellen;
  1563.              Neu_Bild;
  1564.            end else Alarm;
  1565.          end;
  1566.    -10 : if Kanal > 0 then
  1567.          begin
  1568.            if (Kanal-10) > 0 then SwitchChannel(Kanal-10) else Alarm;
  1569.          end else
  1570.          begin
  1571.            if multiTNC then
  1572.            begin
  1573.              dec(Unproto);
  1574.              if Unproto < 1 then unproto := TNC_Anzahl;
  1575.              Unproto_darstellen;
  1576.              Neu_Bild;
  1577.            end else Alarm;
  1578.          end;
  1579.   end;
  1580. End;
  1581.  
  1582. Procedure Trennzeilen (* Kanal : Byte; KC : SonderTaste *);
  1583. var   i,i1,
  1584.       Art  : Byte;
  1585.       Flag : Boolean;
  1586. Begin
  1587.   with K[Kanal]^ do
  1588.   begin
  1589.     Flag := RX_TX_Win;
  1590.     if Flag then Change_WIN;
  1591.  
  1592.     case KC of
  1593.       _ShHome : if Flag and (Kanal > 0) then Art := 2 else Art := 1;
  1594.       _ShEnd  : if Flag and (Kanal > 0) then Art := 1 else Art := 2;
  1595.       _ShPgUp : Art := 3;
  1596.       _ShPgDn : Art := 4;
  1597.           else  Art := 0;
  1598.     end;
  1599.  
  1600.     case Art of
  1601.      1 : if ((Kanal > 0) and (ObStat > 3)) or
  1602.             ((Kanal = 0) and (ObStat > (TicAnz + 3))) then
  1603.          begin               (* obere TrennZeile nach oben *)
  1604.            if Kanal = 0 then i1 := TicAnz else i1 := 0;
  1605.            dec(ObStat);
  1606.            if Y1C + i1 >= ObStat then if Y1C > 1 then dec(Y1C) else inc(stC);
  1607.            if Y1V + i1 >= ObStat then if Y1V > 1 then dec(Y1V) else inc(stV);
  1608.          end else Alarm;
  1609.  
  1610.      2 : if (ObStat <= VorZeilen - VorCmdZeilen) and
  1611.              ((ObStat+4 < UnStat) or (Kanal = 0) and (ObStat+3 < maxZ)) then
  1612.          begin       (* obere TrennZeile nach unten *)
  1613.            inc(ObStat);
  1614.            if stC - VorZeilen + VorCmdZeilen - Y1C > 0
  1615.             then if Y1C < VorCmdZeilen then inc(Y1C);
  1616.            if stV-Y1V > 0 then inc(Y1V);
  1617.          end else Alarm;
  1618.  
  1619.      3 : if Kanal > 0 then    (* untere TrennZeile nach oben *)
  1620.          begin
  1621.            if UnStat > ObStat + 4 then
  1622.            begin
  1623.              dec(UnStat);
  1624.              if UnStat = maxZ-1 then UnStat := maxZ-2;
  1625.            end else Alarm;
  1626.          end else Alarm;
  1627.  
  1628.      4 : if Kanal > 0 then    (* untere TrennZeile nach unten *)
  1629.          begin
  1630.            if UnStat < maxZ then
  1631.            Begin
  1632.              inc(UnStat);
  1633.              if UnStat = maxZ-1 then UnStat := maxZ;
  1634.            End else Alarm;
  1635.          end else Alarm;
  1636.  
  1637.     end;
  1638.  
  1639.     if GlobalTrenn and (Kanal > 0) then
  1640.     begin
  1641.       K[0]^.ObStat := ObStat;
  1642.       for i := 1 to maxLink do
  1643.       begin
  1644.         K[i]^.ObStat := ObStat;
  1645.         K[i]^.UnStat := UnStat;
  1646.       end; 
  1647.     end;
  1648.  
  1649.     Fenster_Berechnen;
  1650.     if Flag then Change_WIN;
  1651.     Neu_Bild;
  1652.   end;
  1653. End;
  1654.  
  1655. Procedure Fenster_Berechnen;
  1656. Var   i : Byte;
  1657. Begin
  1658.   for i := 0 to maxLink do with K[i]^ do
  1659.   begin
  1660.     if i > 0 then
  1661.     begin
  1662.       if RX_TX_Win then
  1663.       begin
  1664.         VBeg := ObStat + 1;
  1665.         VEnd := UnStat - 1;
  1666.         QBeg := 1;
  1667.         QEnd := ObStat - 1;
  1668.       end else
  1669.       begin
  1670.         VBeg := 1;
  1671.         VEnd := ObStat - 1;
  1672.         QBeg := ObStat + 1;
  1673.         QEnd := UnStat - 1;
  1674.       end;
  1675.     end else
  1676.     begin
  1677.       if ObStat <= (TicAnz + 2) then
  1678.       begin
  1679.         ObStat := TicAnz + 3;
  1680.         UnStat := ObStat + 1;
  1681.       end;
  1682.       VBeg := TicAnz + 1;
  1683.       VEnd := ObStat - 1;
  1684.       UnStat := ObStat + 1;
  1685.       QBeg := 0;
  1686.       QEnd := 0;
  1687.     end;
  1688.     Vofs := VBeg - 1;
  1689.   end;
  1690. End;
  1691.  
  1692. Procedure Change_WIN;
  1693. Var  i,zv,zq : Byte;
  1694. Begin
  1695.   for i := 1 to maxLink do with K[i]^ do
  1696.   begin
  1697.     zv := VEnd - VBeg + 1;
  1698.     zq := QEnd - QBeg + 1;
  1699.     if RX_TX_Win then
  1700.     begin
  1701.       VBeg := 1;
  1702.       VEnd := VBeg + zv - 1;
  1703.       ObStat := VEnd + 1;
  1704.       QBeg := ObStat + 1;
  1705.       QEnd := QBeg + zq - 1;
  1706.     end else
  1707.     begin
  1708.       QBeg := 1;
  1709.       QEnd := QBeg + zq - 1;
  1710.       ObStat := QEnd + 1;
  1711.       VBeg := ObStat + 1;
  1712.       VEnd := VBeg + zv - 1;
  1713.     end;
  1714.     Vofs := VBeg - 1;
  1715.   end;
  1716.   RX_TX_Win := not RX_TX_Win;
  1717. End;
  1718.  
  1719.  
  1720. Procedure ClearVorBuffer (* Kanal : Byte *);
  1721. var   i : Byte;
  1722. Begin
  1723.   with K[Kanal]^ do
  1724.   begin
  1725.     if Vor_im_EMS then EMS_Seite_Einblenden(Kanal,Vor);
  1726.     if cmd then
  1727.       for i := VorZeilen-VorCmdZeilen+1 to VorZeilen do
  1728.                VorWrite[Kanal]^[i][0] := Chr(2)
  1729.     else for i := 1 to VorZeilen-VorCmdZeilen do VorWrite[Kanal]^[i] := '';
  1730.     Chr_Darstell(Kanal,_CtrlPgUp,#255);
  1731.   end;
  1732. End;
  1733.  
  1734. Procedure ClearScrBuffer (* Kanal : Byte *);
  1735. var     Result : Word;
  1736. Begin
  1737.   with K[Kanal]^ do
  1738.   begin
  1739.     GetMem(Page,maxNotCh);
  1740.     FillChar(Page^,maxNotCh,0);
  1741.     if use_Vdisk then
  1742.     begin
  1743.       FiResult := ResetBin(ScrollFile,T);
  1744.       Seek(ScrollFile,Pos_im_Scr);
  1745.       BlockWrite(ScrollFile,Page^[0],maxNotCh,Result);
  1746.       FiResult := CloseBin(ScrollFile);
  1747.     end else if use_XMS then
  1748.     begin
  1749.       Data_to_XMS(@Page^[0],XMS_Handle,Pos_im_Scr,maxNotCh);
  1750.     end else if use_EMS then
  1751.     begin
  1752.       EMS_Seite_einblenden(Kanal,Scr);
  1753.       move(Page^,NotCh[Kanal]^,maxNotCh);
  1754.     end else move(Page^,NotCh[Kanal]^,maxNotCh);
  1755.     FreeMem(Page,maxNotCh);
  1756.     X2 := 1;
  1757.     NotPos := 0;
  1758.     NZeile := '';
  1759.     RxLRet := true;
  1760.     Neu_Bild;
  1761.   end;
  1762. End;
  1763.  
  1764. Function GetWeekDay (* Dstr : Str8) : Str2 *);
  1765. var   Tag,Monat,Jahr,
  1766.       i,x,y,z,Fehler  : Integer;
  1767. Begin
  1768.   val(copy(Dstr,1,2),Tag,Fehler);
  1769.   if Fehler = 0 then val(copy(Dstr,4,2),Monat,Fehler);
  1770.   if Fehler = 0 then val(copy(Dstr,7,2),Jahr,Fehler);
  1771.   if Fehler = 0 then
  1772.   begin
  1773.     Jahr := Jahr + 1900;
  1774.     if Monat > 2 then Monat := Monat - 2 else
  1775.     begin
  1776.       Monat := Monat + 10;
  1777.       Jahr := Jahr - 1;
  1778.     end;
  1779.     x := Jahr mod 100;
  1780.     z := Jahr div 100;
  1781.     y := (13 * Monat - 1) div 5 + x div 4 + z div 4;
  1782.     i := (x + y + Tag - 2 * z) mod 7;
  1783.     if (i >= 0) and (i <= 6)
  1784.       then GetWeekDay := copy(ParmStr(i+1,B1,WeekDayStr),1,2)
  1785.       else GetWeekDay := 'xx';
  1786.   end else GetWeekDay := 'xx';
  1787. End;
  1788.  
  1789.  
  1790. Procedure Compress_Ein_Aus (* Kanal : Byte *);
  1791. Begin
  1792.   with K[Kanal]^ do
  1793.   begin
  1794.     if (MldOk = 19) and not RxComp then
  1795.     begin
  1796.       RxComp := true;
  1797.       if not TxComp then S_PAC(Kanal,NU,true,M1 + Meldung[21] + M1);
  1798.       TxComp := true;
  1799.     end else if (MldOk = 20) and RxComp then
  1800.     begin
  1801.       if TxComp then S_PAC(Kanal,NU,true,M1 + Meldung[22] + M1);
  1802.       RxComp := false;
  1803.       TxComp := false;
  1804.       MeldeZeile := '';
  1805.     end else if (MldOk = 21) and not RxComp then
  1806.     begin
  1807.       RxComp := true;
  1808.     end else if (MldOk = 22) and RxComp then
  1809.     begin
  1810.       RxComp := false;
  1811.       TxComp := false;
  1812.       MeldeZeile := '';
  1813.     end;
  1814.  
  1815.     if RxComp then
  1816.     begin
  1817.       CompZeile := '';
  1818.       MeldeCompZ := '';
  1819.     end;
  1820.  
  1821.     if TxComp then
  1822.     begin
  1823.       if PacLen > maxCompPac then PacLen := maxCompPac;
  1824.     end;
  1825.  
  1826.     SetzeFlags(Kanal);
  1827.   end;
  1828. End;
  1829.  
  1830.  
  1831. Procedure CompressMenu (* Kanal : Byte *);
  1832. Const  ArtMax = 5;
  1833. Var    i    : Byte;
  1834.        KC   : Sondertaste;
  1835.        VC   : Char;
  1836.        AFlag,
  1837.        Flag : Boolean;
  1838.        X,Y,
  1839.        Art  : Byte;
  1840.  
  1841. Begin
  1842.   with K[Kanal]^ do
  1843.   begin
  1844.     Moni_Off(0);;
  1845.     Flag := false;
  1846.     AFlag := false;
  1847.     for i := 9 to 15 do G^.Fstx[i] := 2;
  1848.     G^.Fstr[7] := InfoZeile(339);
  1849.     G^.Fstr[9] := InfoZeile(340);
  1850.     G^.Fstr[10] := InfoZeile(341);
  1851.     G^.Fstr[11] := InfoZeile(342);
  1852.     G^.Fstr[12] := InfoZeile(343);
  1853.  
  1854.     if not (TxComp or RxComp) then Art := 1 else
  1855.      if TxComp and RxComp then Art := 2 else
  1856.       if TxComp then Art := 3 else
  1857.        if RxComp then Art := 4
  1858.                  else Art := 1;
  1859.  
  1860.     Repeat
  1861.       for i := 9 to 12 do
  1862.       begin
  1863.         G^.Fstr[i][vM+1] := B1;
  1864.         G^.Fstr[i][hM+1] := B1;
  1865.         G^.Fstr[i][vM] := B1;
  1866.         G^.Fstr[i][hM] := B1;
  1867.       end;
  1868.  
  1869.       if Art in [1..4] then
  1870.       begin
  1871.         X := vM;
  1872.         Y := Art + 8;
  1873.       end else
  1874.       begin
  1875.         X := hM;
  1876.         Y := Art + 4;
  1877.       end;
  1878.       G^.Fstr[Y][X] := A_ch;
  1879.  
  1880.       if HardCur then SetzeCursor(X+1,Y);
  1881.  
  1882.       if TxComp then G^.Fstr[11][vM+1] := X_ch;
  1883.       if RxComp then G^.Fstr[12][vM+1] := X_ch;
  1884.  
  1885.       G^.Fstr[13] := '';
  1886.       G^.Fstr[14] := '';
  1887.       G^.Fstr[15] := '';
  1888.       Fenster;
  1889.  
  1890.       _ReadKey(KC,VC);
  1891.       Case KC of
  1892.        _AltH : TOP_Help(G^.OHelp[25]);
  1893.         _Esc : Flag := true;
  1894.  
  1895.         _Ret : ;
  1896.  
  1897.          _F1 : Art := 1;
  1898.          _F2 : Art := 2;
  1899.          _F3 : Art := 3;
  1900.          _F4 : Art := 4;
  1901.          _F5 : Art := 5;
  1902.  
  1903.          _Up : if Art > 1  then dec(Art)
  1904.                            else Alarm;
  1905.  
  1906.          _Dn : if Art < ArtMax then inc(Art)
  1907.                                else Alarm;
  1908.  
  1909.       _Right : if Art < ArtMax  then
  1910.                begin
  1911.                  Art := Art + 4;
  1912.                  if Art > ArtMax then Art := ArtMax;
  1913.                end else Alarm;
  1914.  
  1915.        _Left : if Art > 1 then
  1916.                begin
  1917.                  if Art <= 4 then Art := 1
  1918.                              else Art := Art - 4;
  1919.                end else Alarm;
  1920.  
  1921.      _Andere :;
  1922.  
  1923.          else Alarm;
  1924.       End;
  1925.  
  1926.       if (KC in [_F1.._F5,_Ret]) or (VC = B1) then
  1927.       case Art of
  1928.         1 : if not (TxComp or RxComp) then
  1929.             begin
  1930.               if Kanal > 0 then S_PAC(Kanal,NU,true,M1 + Meldung[19] + M1);
  1931.               TxComp := true;
  1932.               Flag := true;
  1933.             end;
  1934.         2 : if TxComp and RxComp then
  1935.             begin
  1936.               if Kanal > 0 then S_PAC(Kanal,NU,true,M1 + Meldung[20] + M1);
  1937.               TxComp := false;
  1938.               Flag := true;
  1939.             end;
  1940.         3 : TxComp := not TxComp;
  1941.         4 : begin
  1942.               RxComp := not RxComp;
  1943.               AFlag := true;
  1944.             end;
  1945.         5 : if TxComp and (Kanal > 0) then
  1946.             begin
  1947.               TxComp := false;
  1948.               S_PAC(Kanal,NU,true,M1 + Meldung[23] + M1);
  1949.               TxComp := true;
  1950.               Flag := true;
  1951.             end else Alarm;
  1952.       end;
  1953.  
  1954.       SetzeFlags(Kanal);
  1955.     Until Flag;
  1956.  
  1957.     if AFlag then
  1958.     begin
  1959.       CompZeile := '';
  1960.       MeldeCompZ := '';
  1961.     end;
  1962.     if TxComp and (PacLen > maxCompPac) then PacLen := maxCompPac;
  1963.     ClrFenster;
  1964.     Neu_Bild;
  1965.     Moni_On;
  1966.   end;
  1967. End;
  1968.  
  1969.  
  1970. Procedure Morse_Menue (* Kanal : Byte *);
  1971. Const  ArtMax = 6;
  1972. Var    i    : Byte;
  1973.        KC   : Sondertaste;
  1974.        VC   : Char;
  1975.        Flag : Boolean;
  1976.        X,Y,
  1977.        Art  : Byte;
  1978.        w    : Word;
  1979.        Hstr : String[70];
  1980.  
  1981.  
  1982. Begin
  1983.   with K[Kanal]^ do
  1984.   begin
  1985.     Moni_Off(0);;
  1986.     Flag := false;
  1987.     for i := 9 to 15 do G^.Fstx[i] := 2;
  1988.     G^.Fstr[7] := InfoZeile(344);
  1989.  
  1990.     G^.Fstr[9] := InfoZeile(345);
  1991.     G^.Fstr[10] := InfoZeile(346);
  1992.     G^.Fstr[11] := InfoZeile(347);
  1993.     G^.Fstr[12] := InfoZeile(348);
  1994.     G^.Fstr[13] := InfoZeile(349);
  1995.  
  1996.     Art := 1;
  1997.  
  1998.     Repeat
  1999.       for i := 9 to 13 do
  2000.       begin
  2001.         G^.Fstr[i][vM+1] := B1;
  2002.         G^.Fstr[i][hM+1] := B1;
  2003.         G^.Fstr[i][vM] := B1;
  2004.         G^.Fstr[i][hM] := B1;
  2005.       end;
  2006.  
  2007.       if Art in [1..5] then
  2008.       begin
  2009.         X := vM;
  2010.         Y := Art + 8;
  2011.       end else
  2012.       begin
  2013.         X := hM;
  2014.         Y := Art + 3;
  2015.       end;
  2016.       G^.Fstr[Y][X] := A_ch;
  2017.  
  2018.       if HardCur then SetzeCursor(X+1,Y);
  2019.  
  2020.       if morsen then G^.Fstr[9][vM+1] := X_ch;
  2021.       if ConMorsen then G^.Fstr[10][vM+1] := X_ch;
  2022.       if ReconMorsen then G^.Fstr[11][vM+1] := X_ch;
  2023.  
  2024.       G^.Fstr[14] := '';
  2025.       G^.Fstr[15] := '';
  2026.       Fenster;
  2027.  
  2028.       _ReadKey(KC,VC);
  2029.       Case KC of
  2030.         _Esc : Flag := true;
  2031.  
  2032.        _AltH : TOP_Help(G^.OHelp[4]);
  2033.  
  2034.         _Ret : ;
  2035.  
  2036.          _F1 : Art := 1;
  2037.          _F2 : Art := 2;
  2038.          _F3 : Art := 3;
  2039.          _F4 : Art := 4;
  2040.          _F5 : Art := 5;
  2041.          _F6 : Art := 6;
  2042.  
  2043.          _Up : if Art > 1  then dec(Art)
  2044.                            else Alarm;
  2045.  
  2046.          _Dn : if Art < ArtMax then inc(Art)
  2047.                                else Alarm;
  2048.  
  2049.       _Right : if Art < ArtMax then
  2050.                begin
  2051.                  Art := Art + 5;
  2052.                  if Art > ArtMax then Art := ArtMax;
  2053.                end else Alarm;
  2054.  
  2055.        _Left : if Art > 1 then
  2056.                begin
  2057.                  if Art <= 5 then Art := 1
  2058.                              else Art := Art - 5;
  2059.                end else Alarm;
  2060.  
  2061.      _Andere : case VC of
  2062.                  B1:;
  2063.                  else Alarm;
  2064.                end;
  2065.          else Alarm;
  2066.       End;
  2067.  
  2068.       if (KC in [_F1.._F6,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  2069.       case Art of
  2070.         1 : begin
  2071.               morsen := not morsen;
  2072.             end;
  2073.         2 : begin
  2074.               ConMorsen := not ConMorsen;
  2075.             end;
  2076.         3 : begin
  2077.               ReconMorsen := not ReconMorsen;
  2078.             end;
  2079.         4 : begin
  2080.               G^.Fstr[12][vM] := S_ch;
  2081.               Fenster;
  2082.               w := Word(6000 div MPause);
  2083.               Hstr := int_str(w);
  2084.               GetString(Hstr,Attrib[3],3,2,15,KC,0,Ins);
  2085.               if KC <> _Esc then
  2086.               begin
  2087.                 w := Word(str_int(Hstr));
  2088.                 if (w > 29) and (w < 300) then
  2089.                 begin
  2090.                   MPause := Word(6000 div w);
  2091.                   Morse(Kanal,OwnCall);
  2092.                 end else Alarm;
  2093.               end;
  2094.             end;
  2095.         5 : begin
  2096.               G^.Fstr[13][vM] := S_ch;
  2097.               Fenster;
  2098.               Hstr := int_str(G^.TonHoehe);
  2099.               GetString(Hstr,Attrib[3],5,2,15,KC,0,Ins);
  2100.               if KC <> _Esc then
  2101.               begin
  2102.                 w := Word(str_int(Hstr));
  2103.                 if w > 99 then
  2104.                 begin
  2105.                   G^.TonHoehe := w;
  2106.                   Morse(Kanal,OwnCall);
  2107.                 end else Alarm;
  2108.               end;
  2109.             end;
  2110.         6 : begin
  2111.               G^.Fstr[9][hM] := S_ch;
  2112.               Fenster;
  2113.               Hstr := '';
  2114.               GetString(Hstr,Attrib[3],70,2,15,KC,0,Ins);
  2115.               if KC <> _Esc then Morse(Kanal,Hstr);
  2116.             end;
  2117.       end;
  2118.  
  2119.     Until Flag;
  2120.  
  2121.     ClrFenster;
  2122.     Neu_Bild;
  2123.     Moni_On;
  2124.   end;
  2125. End;
  2126.  
  2127.  
  2128. Procedure Voice_Menue (* Kanal : Byte *);
  2129. Const  ArtMax = 5;
  2130. Var    i    : Byte;
  2131.        KC   : Sondertaste;
  2132.        VC   : Char;
  2133.        Flag : Boolean;
  2134.        X,Y,
  2135.        Art  : Byte;
  2136.        w    : Word;
  2137.        Hstr : String[70];
  2138.  
  2139.  
  2140. Begin
  2141.   with K[Kanal]^ do
  2142.   begin
  2143.     Moni_Off(0);;
  2144.     Flag := false;
  2145.     for i := 9 to 15 do G^.Fstx[i] := 2;
  2146.     G^.Fstr[7] := InfoZeile(350);
  2147.  
  2148.     G^.Fstr[9] := InfoZeile(351);
  2149.     G^.Fstr[10] := InfoZeile(352);
  2150.     G^.Fstr[11] := InfoZeile(353);
  2151.     G^.Fstr[12] := InfoZeile(354);
  2152.     G^.Fstr[13] := InfoZeile(355);
  2153.  
  2154.     Art := 1;
  2155.  
  2156.     Repeat
  2157.       for i := 9 to 13 do
  2158.       begin
  2159.         G^.Fstr[i][vM+1] := B1;
  2160.         G^.Fstr[i][hM+1] := B1;
  2161.         G^.Fstr[i][vM] := B1;
  2162.         G^.Fstr[i][hM] := B1;
  2163.       end;
  2164.  
  2165.       X := vM;
  2166.       Y := Art + 8;
  2167.  
  2168.       G^.Fstr[Y][X] := A_ch;
  2169.  
  2170.       if HardCur then SetzeCursor(X+1,Y);
  2171.  
  2172.       if Speek then G^.Fstr[9][vM+1] := X_ch;
  2173.       if ConVoice then G^.Fstr[10][vM+1] := X_ch;
  2174.       if ReconVoice then G^.Fstr[11][vM+1] := X_ch;
  2175.  
  2176.       G^.Fstr[14] := '';
  2177.       G^.Fstr[15] := '';
  2178.       Fenster;
  2179.  
  2180.       _ReadKey(KC,VC);
  2181.       Case KC of
  2182.         _Esc : Flag := true;
  2183.  
  2184.        _AltH : TOP_Help(G^.OHelp[2]);
  2185.  
  2186.         _Ret : ;
  2187.  
  2188.          _F1 : Art := 1;
  2189.          _F2 : Art := 2;
  2190.          _F3 : Art := 3;
  2191.          _F4 : Art := 4;
  2192.          _F5 : Art := 5;
  2193.  
  2194.          _Up : if Art > 1  then dec(Art)
  2195.                            else Alarm;
  2196.  
  2197.          _Dn : if Art < ArtMax then inc(Art)
  2198.                                else Alarm;
  2199.  
  2200.  
  2201.      _Andere : case VC of
  2202.                  B1:;
  2203.                  else Alarm;
  2204.                end;
  2205.          else Alarm;
  2206.       End;
  2207.  
  2208.       if (KC in [_F1.._F5,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  2209.       case Art of
  2210.         1 : begin
  2211.               Speek := not Speek;
  2212.             end;
  2213.         2 : begin
  2214.               ConVoice := not ConVoice;
  2215.             end;
  2216.         3 : begin
  2217.               ReconVoice := not ReconVoice;
  2218.             end;
  2219.         4 : begin
  2220.               G^.Fstr[12][vM] := S_ch;
  2221.               Fenster;
  2222.               Hstr := int_str(VSpeed);
  2223.               GetString(Hstr,Attrib[3],3,2,15,KC,0,Ins);
  2224.               if KC <> _Esc then
  2225.               begin
  2226.                 w := Word(str_int(Hstr));
  2227.                 if (w > 1) and (w < FFFF) then
  2228.                 begin
  2229.                   VSpeed := w;
  2230.                   Sprechen(OwnCall);
  2231.                 end else Alarm;
  2232.               end;
  2233.             end;
  2234.         5 : begin
  2235.               G^.Fstr[13][vM] := S_ch;
  2236.               Fenster;
  2237.               Hstr := '';
  2238.               GetString(Hstr,Attrib[3],70,2,15,KC,0,Ins);
  2239.               if KC <> _Esc then Sprechen(Hstr);
  2240.             end;
  2241.       end;
  2242.  
  2243.     Until Flag;
  2244.  
  2245.     ClrFenster;
  2246.     Neu_Bild;
  2247.     Moni_On;
  2248.   end;
  2249. End;
  2250.  
  2251. Procedure Text_Einstellung (* Kanal : Byte *);
  2252. Const  ArtMax = 5;
  2253. Var    i     : Byte;
  2254.        KC    : Sondertaste;
  2255.        VC    : Char;
  2256.        IFlag,
  2257.        Flag  : Boolean;
  2258.        X,Y,
  2259.        Art   : Byte;
  2260.        Hstr  : String[3];
  2261.  
  2262. Begin
  2263.   with K[Kanal]^ do
  2264.   begin
  2265.     Moni_Off(0);;
  2266.     Flag := false;
  2267.     IFlag := false;
  2268.     for i := 9 to 15 do G^.Fstx[i] := 2;
  2269.     G^.Fstr[7] := InfoZeile(356);
  2270.  
  2271.     Art := 1;
  2272.  
  2273.     Repeat
  2274.       X := vM;
  2275.       Y := Art + 8;
  2276.  
  2277.       if HardCur then SetzeCursor(X+1,Y);
  2278.  
  2279.       G^.Fstr[9] := InfoZeile(357) + B1 + int_str(TNC[TncNummer]^.CText);
  2280.       G^.Fstr[10] := InfoZeile(358)+ B1 + int_str(TNC[TncNummer]^.Info);
  2281.       G^.Fstr[11] := InfoZeile(359)+ B1 + int_str(TNC[TncNummer]^.Aktuell);
  2282.       G^.Fstr[12] := InfoZeile(360)+ B1 + int_str(TNC[TncNummer]^.QText);
  2283.       G^.Fstr[13] := InfoZeile(361)+ B1 + int_str(TNC[TncNummer]^.Fix);
  2284.  
  2285.       G^.Fstr[Y][X] := A_ch;
  2286.  
  2287.       G^.Fstr[14] := '';
  2288.       G^.Fstr[15] := '';
  2289.       Fenster;
  2290.  
  2291.       _ReadKey(KC,VC);
  2292.       Case KC of
  2293.         _Esc : Flag := true;
  2294.  
  2295.        _AltH : TOP_Help(G^.OHelp[9]);
  2296.  
  2297.         _Ret : ;
  2298.  
  2299.          _F1 : Art := 1;
  2300.          _F2 : Art := 2;
  2301.          _F3 : Art := 3;
  2302.          _F4 : Art := 4;
  2303.          _F5 : Art := 5;
  2304.  
  2305.          _Up : if Art > 1  then dec(Art)
  2306.                            else Alarm;
  2307.  
  2308.          _Dn : if Art < ArtMax then inc(Art)
  2309.                                else Alarm;
  2310.  
  2311.      _Andere : case VC of
  2312.                  B1:;
  2313.                  else Alarm;
  2314.                end;
  2315.          else Alarm;
  2316.       End;
  2317.  
  2318.       if (KC in [_F1.._F5,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  2319.       begin
  2320.         case Art of
  2321.           1 : begin
  2322.                 G^.Fstr[9][vM] := S_ch;
  2323.                 Hstr := int_str(TNC[TncNummer]^.CText);
  2324.               end;
  2325.           2 : begin
  2326.                 G^.Fstr[10][vM] := S_ch;
  2327.                 Hstr := int_str(TNC[TncNummer]^.Info);
  2328.               end;
  2329.           3 : begin
  2330.                 G^.Fstr[11][vM] := S_ch;
  2331.                 Hstr := int_str(TNC[TncNummer]^.Aktuell);
  2332.               end;
  2333.           4 : begin
  2334.                 G^.Fstr[12][vM] := S_ch;
  2335.                 Hstr := int_str(TNC[TncNummer]^.QText);
  2336.               end;
  2337.           5 : begin
  2338.                 G^.Fstr[13][vM] := S_ch;
  2339.                 Hstr := int_str(TNC[TncNummer]^.Fix);
  2340.               end;
  2341.         end;
  2342.  
  2343.         Fenster;
  2344.         GetString(Hstr,Attrib[3],3,2,15,KC,0,IFlag);
  2345.         if KC <> _Esc then
  2346.         begin
  2347.           i := Byte(str_int(Hstr));
  2348.           case Art of
  2349.             1 : TNC[TncNummer]^.CText := i;
  2350.             2 : TNC[TncNummer]^.Info := i;
  2351.             3 : TNC[TncNummer]^.Aktuell := i;
  2352.             4 : TNC[TncNummer]^.QText := i;
  2353.             5 : TNC[TncNummer]^.Fix := i;
  2354.           end;
  2355.         end;
  2356.       end;
  2357.  
  2358.     Until Flag;
  2359.  
  2360.     ClrFenster;
  2361.     Neu_Bild;
  2362.     Moni_On;
  2363.   end;
  2364. End;
  2365.  
  2366.  
  2367. Procedure QRG_Einstellen (* Kanal : Byte; Zeile : Str8 *);
  2368. Const  Bofs = 2;
  2369. Var    TNr,i,i1,i2,
  2370.        Bpos      : Byte;
  2371.        Dpos      : Integer;
  2372.        w         : Word;
  2373.        yM,
  2374.        Zmax      : Byte;
  2375.        Flag,
  2376.        Cursor,
  2377.        Fertig    : Boolean;
  2378.        Hstr      : String[60];
  2379.        KC        : Sondertaste;
  2380.        VC        : Char;
  2381.        Such      : String[9];
  2382.  
  2383.   Procedure InitVar;
  2384.   Begin
  2385.     yM := 1;
  2386.     Bpos := 1;
  2387.     Dpos := 1;
  2388.   End;
  2389.  
  2390.   Function GetQrgStr(QPos : Word) : Str80;
  2391.   Begin
  2392.     GetQrgStr := B1 + EFillStr(79,B1,EFillStr(10,B1,G^.QRG[QPos].CALL) +
  2393.                                  GL + B1 + G^.QRG[QPos].QRG);
  2394.   End;
  2395.  
  2396.   Procedure QrgPage(beg : Word);
  2397.   Var   i,i1 : Byte;
  2398.   Begin
  2399.     Teil_Bild_Loesch(3,maxZ-1,Attrib[2]);
  2400.     i1 := Zmax;
  2401.     if i1 > G^.QRG_Anz then i1 := G^.QRG_Anz;
  2402.     for i := 1 to i1 do
  2403.        WriteRam(1,i+Bofs,Attrib[2],0,EFillStr(80,B1,GetQrgStr(beg-1+i)));
  2404.   End;
  2405.  
  2406. Begin
  2407.   if Kanal = 0 then TNr := Unproto
  2408.                else TNr := K[Kanal]^.TncNummer;
  2409.  
  2410.   if Zeile > '' then
  2411.   begin
  2412.     TNC[TNr]^.QRG_Akt := UpCaseStr(Zeile);
  2413.     TNC[TNr]^.TicStr := ConstStr(B1,TL);
  2414.     Status2;
  2415.   end else
  2416.   begin
  2417.     NowFenster := false;
  2418.     Moni_Off(0);;
  2419.     InitVar;
  2420.  
  2421.     Such := '';
  2422.     Zmax := maxZ - (1 + Bofs);
  2423.     Fertig := false;
  2424.     Cursor := true;
  2425.  
  2426.     WriteRam(1,1,Attrib[15],0,EFillStr(80,B1,B1 + InfoZeile(229)));
  2427.     WriteRam(1,2,Attrib[2],0,ConstStr('─',80));
  2428.     WriteRam(1,maxZ,Attrib[15],0,ConstStr(B1,80));
  2429.     QrgPage(Dpos);
  2430.     WriteAttr(1,Bpos+Bofs,80,Attrib[4],0);
  2431.  
  2432.     Repeat
  2433.       if Cursor then InitCursor(1,Bpos+Bofs)
  2434.                 else InitCursor(1,1);
  2435.  
  2436.       WriteRam(60,1,Attrib[15],0,'Nr:' + SFillStr(3,B1,int_str(Dpos)));
  2437.       WriteRam(71,1,Attrib[15],0,EFillStr(10,B1,Such));
  2438.  
  2439.       _ReadKey(KC,VC);
  2440.  
  2441.       if KC <> _Andere then Such := '';
  2442.  
  2443.       case KC of
  2444.         _Esc, _Del
  2445.          : Fertig := true;
  2446.  
  2447.         _AltH
  2448.          : TOP_Help(G^.OHelp[8]);
  2449.  
  2450.         _Dn
  2451.          : if Dpos < G^.QRG_Anz then
  2452.            begin
  2453.              inc(Dpos);
  2454.              if Bpos < Zmax then inc(Bpos) else
  2455.              begin
  2456.                WriteAttr(1,Bofs+yM,80,Attrib[2],0);
  2457.                Scroll(Up,0,1+Bofs,Zmax+Bofs);
  2458.                WriteRam(1,Bofs+Bpos,Attrib[4],0,GetQrgStr(Dpos));
  2459.              end;
  2460.            end else Alarm;
  2461.  
  2462.         _Up
  2463.          : if Dpos > 1 then
  2464.            begin
  2465.              dec(Dpos);
  2466.              if Bpos > 1 then dec(Bpos) else
  2467.              begin
  2468.                WriteAttr(1,Bofs+yM,80,Attrib[2],0);
  2469.                Scroll(Dn,0,1+Bofs,Zmax+Bofs);
  2470.                WriteRam(1,Bofs+Bpos,Attrib[4],0,GetQrgStr(Dpos));
  2471.              end;
  2472.            end else Alarm;
  2473.  
  2474.         _PgDn
  2475.          : if Dpos < G^.QRG_Anz then
  2476.            begin
  2477.              if Dpos + Zmax - Bpos >= G^.QRG_Anz then
  2478.              begin
  2479.                Dpos := G^.QRG_Anz;
  2480.                Bpos := Zmax;
  2481.                if Bpos > G^.QRG_Anz then Bpos := G^.QRG_Anz;
  2482.              end else
  2483.              begin
  2484.                Dpos := Dpos + Zmax - 1;
  2485.                if Dpos + Zmax - 1 > G^.QRG_Anz then Dpos := G^.QRG_Anz - Zmax + Bpos;
  2486.                QrgPage(Dpos - Bpos + 1);
  2487.              end;
  2488.            end else Alarm;
  2489.  
  2490.         _PgUp
  2491.          : if Dpos > 1 then
  2492.            begin
  2493.              if Dpos <= Bpos then
  2494.              begin
  2495.                Dpos := 1;
  2496.                Bpos := 1;
  2497.              end else
  2498.              begin
  2499.                Dpos := Dpos - Zmax + 1;
  2500.                if Dpos - Zmax + 1 < 1 then Dpos := Bpos;
  2501.                QrgPage(Dpos - Bpos + 1);
  2502.              end;
  2503.            end else Alarm;
  2504.  
  2505.         _CtrlPgUp
  2506.          : if Dpos > 1 then
  2507.            begin
  2508.              Dpos := 1;
  2509.              Bpos := 1;
  2510.              QrgPage(1);
  2511.            end else Alarm;
  2512.  
  2513.         _CtrlPgDn
  2514.          : if Dpos < G^.QRG_Anz then
  2515.            begin
  2516.              Dpos := G^.QRG_Anz;
  2517.              Bpos := Zmax;
  2518.              if Bpos > G^.QRG_Anz then Bpos := G^.QRG_Anz;
  2519.              QrgPage(Dpos - Bpos + 1);
  2520.            end else Alarm;
  2521.  
  2522.         _CtrlHome
  2523.          : begin
  2524.              Dpos := Dpos - Bpos + 1;
  2525.              Bpos := 1;
  2526.            end;
  2527.  
  2528.         _CtrlEnd
  2529.          : if G^.QRG_Anz < Zmax then
  2530.            begin
  2531.              Dpos := G^.QRG_Anz;
  2532.              Bpos := G^.QRG_Anz;
  2533.            end else
  2534.            begin
  2535.              Dpos := Dpos + Zmax - Bpos;
  2536.              Bpos := Zmax;
  2537.            end;
  2538.  
  2539.         _ShTab
  2540.          : Cursor := not Cursor;
  2541.  
  2542.         _Ret
  2543.          : begin
  2544.              TNC[TNr]^.QRG_Akt := G^.QRG[Dpos].QRG;
  2545.              TNC[TNr]^.TicStr := ConstStr(B1,TL);
  2546.              fertig := true;
  2547.            end;
  2548.  
  2549.         _Andere
  2550.          : begin
  2551.              Such := Such + UpCase(VC);
  2552.              w := 0;
  2553.              Flag := false;
  2554.              While (w < G^.QRG_Anz) and not Flag do
  2555.              begin
  2556.                inc(w);
  2557.                if pos(Such,G^.QRG[w].CALL) = 1 then
  2558.                begin
  2559.                  Flag := true;
  2560.                  Dpos := w;
  2561.                  if (Dpos < Bpos) or (G^.QRG_Anz <= Zmax) then Bpos := Dpos;
  2562.                  if ((G^.QRG_Anz - Dpos + Bpos) < Zmax) and
  2563.                     (G^.QRG_Anz > Zmax) and (Dpos > Bpos)
  2564.                   then Bpos := Zmax - (G^.QRG_Anz - Dpos);
  2565.                end;
  2566.              end;
  2567.  
  2568.              if not Flag then
  2569.              begin
  2570.                Alarm;
  2571.                Such := '';
  2572.              end else QrgPage(Dpos - Bpos + 1);
  2573.            end;
  2574.  
  2575.         else Alarm;
  2576.       end;
  2577.  
  2578.       WriteAttr(1,Bofs+yM,80,Attrib[2],0);
  2579.       WriteAttr(1,Bofs+Bpos,80,Attrib[4],0);
  2580.       yM := Bpos;
  2581.     Until Fertig;
  2582.  
  2583.     Neu_Bild;
  2584.     Moni_On;
  2585.   end;
  2586. End;
  2587.  
  2588.  
  2589. Procedure Verschiedene_Einstellungen (* Kanal : Byte *);
  2590. Const  ArtMax = 10;
  2591. Var    i     : Byte;
  2592.        KC    : Sondertaste;
  2593.        VC    : Char;
  2594.        Flag,
  2595.        Flag1 : Boolean;
  2596.        X,Y,
  2597.        Art   : Byte;
  2598.  
  2599. Begin
  2600.   with K[Kanal]^ do
  2601.   begin
  2602.     Moni_Off(0);
  2603.     Flag := false;
  2604.     Flag1 := false;
  2605.  
  2606.     for i := 9 to 15 do G^.Fstx[i] := 2;
  2607.     G^.Fstr[7] := InfoZeile(362);
  2608.     G^.Fstr[9] := InfoZeile(363);
  2609.     G^.Fstr[10] := InfoZeile(364);
  2610.     G^.Fstr[11] := InfoZeile(365);
  2611.     G^.Fstr[12] := InfoZeile(366);
  2612.     G^.Fstr[13] := InfoZeile(367);
  2613.  
  2614.     Art := 1;
  2615.  
  2616.     Repeat
  2617.       for i := 9 to 13 do
  2618.       begin
  2619.         G^.Fstr[i][vM+1] := B1;
  2620.         G^.Fstr[i][hM+1] := B1;
  2621.         G^.Fstr[i][vM] := B1;
  2622.         G^.Fstr[i][hM] := B1;
  2623.       end;
  2624.  
  2625.       if Art in [1..5] then
  2626.       begin
  2627.         X := vM;
  2628.         Y := Art + 8;
  2629.       end else
  2630.       begin
  2631.         X := hM;
  2632.         Y := Art + 3;
  2633.       end;
  2634.       G^.Fstr[Y][X] := A_ch;
  2635.  
  2636.       if HardCur then SetzeCursor(X+1,Y);
  2637.  
  2638.       if FileSend then
  2639.       begin
  2640.         case TX_Bin of
  2641.           0 : G^.Fstr[9][vM+1] := X_ch;
  2642.           1 : G^.Fstr[11][vM+1] := X_ch;
  2643.           2 : G^.Fstr[10][vM+1] := 'x';
  2644.           3 : G^.Fstr[10][vM+1] := X_ch;
  2645.         end;
  2646.       end;
  2647.  
  2648.       if _VGA then G^.Fstr[9][vM+1] := X_ch;
  2649.       if (Kanal > 0) and TxBeepAck then G^.Fstr[10][vM+1] := X_ch;
  2650.       if (Kanal > 0) and Rx_Beep then G^.Fstr[11][vM+1] := X_ch;
  2651.       if CtrlBeep then G^.Fstr[12][vM+1] := X_ch;
  2652.       if (Kanal > 0) and Auto then G^.Fstr[13][vM+1] := X_ch;
  2653.  
  2654.       if ((Kanal = 0) and NoBinMon) or
  2655.          ((Kanal > 0) and not BinOut) then G^.Fstr[9][hM+1] := X_ch;
  2656.       if TopBox then G^.Fstr[10][hM+1] := X_ch;
  2657.       if (Kanal > 0) and RemAll then G^.Fstr[11][hM+1] := X_ch;
  2658.       if (Kanal > 0) and SPlus then G^.Fstr[12][hM+1] := X_ch;
  2659.       if (Kanal > 0) and AutoBin then G^.Fstr[13][hM+1] := X_ch;
  2660.  
  2661.       G^.Fstr[14] := '';
  2662.       G^.Fstr[15] := '';
  2663.       Fenster;
  2664.  
  2665.       _ReadKey(KC,VC);
  2666.       Case KC of
  2667.         _Esc : Flag := true;
  2668.  
  2669.        _AltH : TOP_Help(G^.OHelp[26]);
  2670.  
  2671.         _Ret : ;
  2672.  
  2673.          _F1 : Art := 1;
  2674.          _F2 : Art := 2;
  2675.          _F3 : Art := 3;
  2676.          _F4 : Art := 4;
  2677.          _F5 : Art := 5;
  2678.          _F6 : Art := 6;
  2679.          _F7 : Art := 7;
  2680.          _F8 : Art := 8;
  2681.          _F9 : Art := 9;
  2682.         _F10 : Art := 10;
  2683.  
  2684.          _Up : if Art > 1  then dec(Art)
  2685.                            else Alarm;
  2686.  
  2687.          _Dn : if Art < ArtMax then inc(Art)
  2688.                                else Alarm;
  2689.  
  2690.       _Right : if Art < ArtMax  then
  2691.                begin
  2692.                  Art := Art + 5;
  2693.                  if Art > ArtMax then Art := ArtMax;
  2694.                end else Alarm;
  2695.  
  2696.        _Left : if Art > 1 then
  2697.                begin
  2698.                  if Art <= 5 then Art := 1
  2699.                              else Art := Art - 5;
  2700.                end else Alarm;
  2701.  
  2702.      _Andere : case VC of
  2703.                  B1:;
  2704.                  else Alarm;
  2705.                end;
  2706.  
  2707.          else Alarm;
  2708.       End;
  2709.  
  2710.       if (KC in [_F1.._F10,_Ret]) or ((KC = _Andere) and (VC = B1)) then
  2711.       case Art of
  2712.         1 : begin
  2713.               _VGA := not _VGA;
  2714.               LastModeStore := LastMode;
  2715.               switch_VGA_Mono;
  2716.               ColorItensity(HighCol);
  2717.               maxZ := Hi(WindMax) + 1;
  2718.               if not _VGA then if maxZ <> 25 then maxZ := 25;
  2719.  
  2720.               Flag1 := RX_TX_Win;
  2721.               if Flag1 then Change_WIN;
  2722.  
  2723.               for i := 0 to maxLink do with K[i]^ do
  2724.               begin
  2725.                 ObStat := 5;
  2726.                 if i = 0 then UnStat := ObStat + 1
  2727.                          else UnStat := maxZ - 2;
  2728.                 stC := (VorZeilen - VorCmdZeilen) + 1;
  2729.                 X1C := 3;
  2730.                 Y1C := 1;
  2731.                 stV := 1;
  2732.                 X1V := 1;
  2733.                 Y1V := 1;
  2734.               end;
  2735.  
  2736.               Fenster_Berechnen;
  2737.               if Flag1 then Change_WIN;
  2738.  
  2739.               Cursor_aus;
  2740.               Flag := true;
  2741.             end;
  2742.  
  2743.         2 : if Kanal > 0 then
  2744.             begin
  2745.               TxBeepAck := not TxBeepAck;
  2746.               if TxBeepAck and Klingel then
  2747.                Beep(G^.TxPiepFreq,G^.TxPiepTime);
  2748.             end else Alarm;
  2749.  
  2750.         3 : if Kanal > 0 then Rx_Beep := not Rx_Beep
  2751.                          else Alarm;
  2752.  
  2753.         4 : CtrlBeep := not CtrlBeep;
  2754.  
  2755.         5 : if Kanal > 0 then Auto := not Auto
  2756.                          else Alarm;
  2757.  
  2758.         6 : if Kanal = 0 then NoBinMon := not NoBinMon
  2759.                          else BinOut := not BinOut;
  2760.  
  2761.         7 : TopBox := not TopBox;
  2762.  
  2763.         8 : if Kanal > 0 then RemAll := not RemAll
  2764.                          else Alarm;
  2765.  
  2766.         9 : If Kanal > 0 then
  2767.             begin
  2768.               if SplSave then Close_7Plus(Kanal)
  2769.                          else SPlus := not SPlus;
  2770.             end else Alarm;
  2771.  
  2772.        10 : If Kanal > 0 then
  2773.             begin
  2774.               AutoBin := not AutoBin;
  2775.               if RX_Bin = 0 then AutoBinOn := AutoBin;
  2776.             end else Alarm;
  2777.       end;
  2778.       SetzeFlags(Kanal);
  2779.     Until Flag;
  2780.     ClrFenster;
  2781.     Neu_Bild;
  2782.     Moni_On;
  2783.   end;
  2784. End;
  2785.  
  2786.  
  2787. Procedure Alt_Disc (* Kanal : Byte *);
  2788. Var  KC   : Sondertaste;
  2789.      VC   : Char;
  2790.      Flag : Boolean;
  2791. Begin
  2792.   Flag := false;
  2793.   if SiDis then
  2794.   begin
  2795.     InfoOut(Kanal,1,1,InfoZeile(167));
  2796.     _ReadKey(KC,VC);
  2797.     VC := UpCase(VC);
  2798.     if (KC =_Ret) or (VC in YesMenge) then Flag := true;
  2799.     Neu_Bild;
  2800.   end else Flag := true;
  2801.   if Flag then S_PAC(Kanal,CM,true,'D');
  2802. End;
  2803.  
  2804.  
  2805. Procedure Auswert_Kopieren (* Kanal : Byte; Zeile : Str80 *);
  2806. Var  i    : Byte;
  2807.      Flag : Boolean;
  2808. Begin
  2809.   with K[Kanal]^ do
  2810.   begin
  2811.     if Kanal > 0 then
  2812.     begin
  2813.       Flag := pos(LZ,Zeile) > 0;
  2814.       if Flag then delete(Zeile,pos(LZ,Zeile),1);
  2815.  
  2816.       Zeile := RestStr(UpCaseStr(Zeile));
  2817.       if Zeile > '' then
  2818.       begin
  2819.         i := Byte(str_int(Zeile));
  2820.         if (i in [1..maxLink]) and K[i]^.connected then
  2821.         begin
  2822.           Kopieren := i;
  2823.           if Flag then K[i]^.Kopieren := Kanal;
  2824.         end else
  2825.         begin
  2826.           Kopieren := 0;
  2827.           if i > 0 then InfoOut(Kanal,1,1,InfoZeile(301));
  2828.         end;
  2829.       end else
  2830.       begin
  2831.         if Kopieren > 0 then
  2832.         begin
  2833.           if Flag then K[Kopieren]^.Kopieren := 0;
  2834.           Kopieren := 0;
  2835.         end else Alarm;
  2836.       end;
  2837.       SetzeFlags(Kanal);
  2838.     End else Alarm;
  2839.   end;
  2840. End;
  2841.  
  2842.  
  2843. Procedure Idle_Einstellen (* Kanal : Byte; Zeile : Str20 *);
  2844. Var  i : Integer;
  2845. Begin
  2846.   Zeile := RestStr(Zeile);
  2847.   if Zeile > '' then
  2848.   begin
  2849.     i := Integer(str_int(CutStr(Zeile)));
  2850.     Idle_Pos := i >= 0;
  2851.     if not Idle_Pos then i := i * -1;
  2852.     Idle_Anz := i;
  2853.     Zeile := RestStr(Zeile);
  2854.     if Zeile > '' then
  2855.     begin
  2856.       Idle_Tout := Word(str_int(Zeile));
  2857.     end;
  2858.     Idle_Count := 0;
  2859.     Idle_TCount := 0;
  2860.   end;
  2861.   i := Idle_Anz;
  2862.   if not Idle_Pos then i := i * -1;
  2863.   InfoOut(Kanal,0,1,int_str(i) + B2 + int_str(Idle_Tout));
  2864. End;
  2865.  
  2866.  
  2867. Procedure Remote_Emulieren(Kanal : Byte; Zeile : Str80);
  2868. Var   Bstr : String[80];
  2869.       Flag : Boolean;
  2870. Begin
  2871.   with K[Kanal]^ do
  2872.   begin
  2873.     if Kanal > 0 then
  2874.     begin
  2875.       Zeile := RestStr(Zeile);
  2876.       Flag := RemAll;
  2877.       RemAll := true;
  2878.       Check_Mld(Kanal,Zeile);
  2879.       if RxComp then
  2880.       begin
  2881.         Bstr := MeldeCompZ;
  2882.         MeldeCompZ := Zeile;
  2883.       end else
  2884.       begin
  2885.         Bstr := MeldeZeile;
  2886.         MeldeZeile := Zeile;
  2887.       end;
  2888.       Connect_Info(Kanal,Attrib[20],true,Zeile + M1);
  2889.       MldOk := 0;
  2890.       if RxComp then MeldeCompZ := Bstr
  2891.                 else MeldeZeile := Bstr;
  2892.       RemAll := Flag;
  2893.     end else InfoOut(Kanal,1,1,InfoZeile(192));
  2894.   end;
  2895. End;
  2896.  
  2897.  
  2898. Procedure GetString(* var S     : Str80;
  2899.                           Attr,
  2900.                           L,X,Y : Byte;
  2901.                       var TC    : Sondertaste;
  2902.                           Art   : Byte;
  2903.                       var Ins   : Boolean *);
  2904. Var
  2905.       i,P   : Byte;
  2906.       VC,
  2907.       VC1   : Char;
  2908.       KC    : Sondertaste;
  2909.       gr    : char;
  2910.       Gross : Boolean;
  2911.  
  2912.  
  2913.   Procedure InitS;
  2914.   Begin
  2915.     VC1 := #255;
  2916.     if L > (SizeOf(S) - 1) then L := SizeOf(S) - 1;
  2917.     P := length(S);
  2918.     if Art = 3 then Art := 0
  2919.                else While (P > 0) and (s[P] <> BS) do dec(P);
  2920.     inc(P);
  2921.   End;
  2922.  
  2923. Begin
  2924.   Gross := true;
  2925.   HistoryCount := 0;
  2926.   FillChar(History^[maxHistory+1],SizeOf(History^[1]),0);
  2927.   if Ins then gr := '_' else gr := Pkt;
  2928.   InitS;
  2929.   Repeat
  2930.     if length(S) > L then S := copy(S,1,L);
  2931.     WriteRam(X,Y,Attr,1,S + ConstStr(gr,L - Length(S)));
  2932.     SetzeCursor(X+P-1,Y);
  2933.     _ReadKey(KC,VC);
  2934.     if Gross then VC := UpCase(VC);
  2935.     case KC of
  2936.       _Andere    : Case VC of
  2937.                     #32..#254
  2938.                       : if (P <= L) and ((length(S) < L) or not Ins) then
  2939.                         begin
  2940.                           Insert(VC,S,P);
  2941.                           inc(P);
  2942.                           if not Ins then delete(S,P,1);
  2943.                         end else Alarm;
  2944.                     ^T: Del_Wort(S,P);
  2945.                     ^Y: begin
  2946.                           P := 1;
  2947.                           S := '';
  2948.                         end;
  2949.                    end;
  2950.       _AltK      : Gross := not Gross;
  2951.         _F2      : if (Art > 0) and not Backscroll(show) then
  2952.                    begin
  2953.                      if pos(':\',S) <> 2 then S := copy(SysPfad,1,3);
  2954.                      if not PfadOk(0,copy(S,1,3)) then S := copy(SysPfad,1,3);
  2955.                      if pos(S_ch,S) = 0 then
  2956.                      begin
  2957.                        While (S[length(S)] <> BS) and (length(S) > 0) do
  2958.                        delete(S,length(S),1);
  2959.                        S := S + Joker;
  2960.                      end;
  2961.                      Cursor_aus;
  2962.                      DirZeig(S,VC1,true);
  2963.                      if (VC1 <> ESC) and (Art = 2) then exit;
  2964.                      Neu_Bild;
  2965.                      Fenster;
  2966.                      InitS;
  2967.                    end;
  2968.    _F1,_F3.._F10 : if Art > 0 then
  2969.                    begin
  2970.                      case KC of
  2971.                        _F1 : S := copy(S,1,P-1) + UpCaseStr(copy(Datum,4,2) +
  2972.                                   copy(Datum,1,2) + copy(Uhrzeit,1,2) +
  2973.                                   copy(Uhrzeit,4,2) + Pkt  +
  2974.                                   SFillStr(3,'0',int_str(show)));
  2975.                        _F3 : S := SysPfad;
  2976.                        _F4 : S := G^.SavePfad;
  2977.                        _F5 : S := G^.Merk_Drive;
  2978.                        _F6 : S := G^.MailPfad;
  2979.                        _F7 : S := G^.Runpfad;
  2980.                        _F8 : S := G^.Binpfad;
  2981.                        _F9 : S := G^.SPlusPfad;
  2982.                       _F10 : S := G^.SavePfad + SaveName + SFillStr(3,'0',int_str(show));
  2983.                      end;
  2984.                      InitS;
  2985.                    end;
  2986.        _Ins      : begin     (* INS *)
  2987.                      Ins := not Ins;
  2988.                      if Ins then gr := '_' else gr := Pkt ;
  2989.                    end;
  2990.       _Left      : if P > 1 then dec(P);
  2991.      _Right      : if P <= Length(S) then inc(P);
  2992.       _Home      : P := 1;
  2993.        _End      : P := Length(S) + 1;
  2994.        _Del      : if P <= Length(S) then Delete(S,P,1);
  2995.   _CtrlLeft,
  2996.   _CtrlRight     : begin
  2997.                      Cur_Wort(S,KC,P,1);
  2998.                    end;
  2999.       _AltH      : TOP_Help(G^.OHelp[18]);
  3000.       _Back      : if P > 1 then
  3001.                    begin
  3002.                      Delete(S,P-1,1);
  3003.                      dec(P);
  3004.                    end;
  3005.         _Up      : if HistoryCount < maxHistory then
  3006.                    begin
  3007.                      if HistoryCount = 0 then History^[maxHistory+1] := S;
  3008.                      inc(HistoryCount);
  3009.                      S := History^[HistoryCount];
  3010.                      InitS;
  3011.                    end else Alarm;
  3012.        _Dn       : if HistoryCount > 0 then
  3013.                    begin
  3014.                      dec(HistoryCount);
  3015.                      if HistoryCount = 0 then S := History^[maxHistory+1]
  3016.                                          else S := History^[HistoryCount];
  3017.                      InitS;
  3018.                    end else Alarm;
  3019.  
  3020.       _Ret       : begin
  3021.                      move(History^[1],History^[2],SizeOf(History^[1])*(maxHistory-1));
  3022.                      History^[1] := S;
  3023.                    end;
  3024.     end;  (* of case *)
  3025.   Until KC in [_Ret,_Esc];
  3026.   TC := KC;
  3027.   Cursor_aus;
  3028. END;
  3029.